squared theme 2.9 released

squared theme 2.9 released

by David Bogner -
Number of replies: 22
Picture of Core developers Picture of Plugin developers
Hi,

we just released the squared theme for Moodle 2.9. Thanks to the great work of Gareth J Barnard, we managed to release a Moodle 2.9 version of the theme.

The next step will be a responsive version of the theme. Anyone who has free resources to provide ideas and improvement suggestions for the responsive version is welcome to post them here or to contact me directly. 

Kind regards,
David


Average of ratings: Useful (3)
In reply to David Bogner

Re: squared theme 2.9 released

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Thanks David, I can't say nice things about the theme yet as I am getting an error that is spoiling the frontpage.

This is the Error:

Notice: Undefined property: stdClass::$alternateloginurl in C:\wamp\www\moodle29\theme\squared\lib.php on line 279

Why is it throwing an error?  Is it something I need to do before selecting the theme? Or is it something you missed?

Thanks,

Mary

In reply to Mary Evans

Re: squared theme 2.9 released

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

Is that after notifications to install and switching to the theme?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: squared theme 2.9 released

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

I thought it was the frontpage, but checking it again it is the page to confirm selection, where you also get the 'Continue' button.

The Notification appears in the Login block.

In reply to Mary Evans

Re: squared theme 2.9 released

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi Mary,

I will have a look at it. Should not be difficult to solve. Maybe saving the theme settings make it go away too. Did you upgrade or did you do a fresh install?

Best,

David

In reply to David Bogner

Re: squared theme 2.9 released

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

It was a fresh install.

Was straightforward.

In reply to Mary Evans

Re: squared theme 2.9 released

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi Mary,

I just uploaded a new version for the theme. The error should be fixed.

Kind regards,

David

In reply to David Bogner

Re: squared theme 2.9 released - Menu drop down

by Carme Frau -

Hello,

I'm trying to configure a drop down menu, but does not works.
I have tried 2,9 and 2,7 versions
 If I change theme, the menu works correctly (Clean and others).
Can you help me?

My moodle is:
http://ceipnovacabana.net/moodle
Thanks!

In reply to Carme Frau

Re: squared theme 2.9 released - Menu drop down

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi,

could you post the code you used in /admin/settings.php?section=themesettings in "Custom menu items"?

Kind regards,

David

In reply to David Bogner

Re: squared theme 2.9 released - Menu drop down

by Carme Frau -

Hi!

I think I have solved the problem. It seems is necessary  click on the schema  icon to view the items menu. Then it works.
Can you confirm this?
I haven't found themesettings in /admin/settings.php.
This section only appears in /admin/settings/appearance.php

Thank you very much.

Kind regards!

In reply to Carme Frau

Re: squared theme 2.9 released - Menu drop down

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi,

I do not know exactly what you mean, but when you are satisfied with the behaviour of the menu, then I think the issue is solved.


Kind regards,

David

In reply to David Bogner

Re: squared theme 2.9 released

by Rodrigo Ribeiro de Abreu -

I have a tricky request, and didn't find how to solve it: I need to use one instalation of moodle with more than one corporations.

I'd like to know if it's possible to show different logos for a group os students..

Let's clarify.

Imagine I will have Corp1 and Corp2 using same instalattion


Corp1

Professors and students fo this corporation see the logo of Corp1 instead of the "M" logo at top right


Corp2

Professors and students of this corporation see the logo of Corp2 instead of the "M" logo at top right


I have attached an image do show what I need.


PS: My Moodle is in Poruguese


Attachment squared.jpg
In reply to Rodrigo Ribeiro de Abreu

Re: squared theme 2.9 released

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi,

you will have to add some CSS that hides the actual logo and uses some body attribute like the category id in order to place a custom logo on each course belonging to a specific category.

Kind regards,

David

Average of ratings: Useful (1)
In reply to Rodrigo Ribeiro de Abreu

Re: squared theme 2.9 released

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Duplicate the theme or pick another theme for the second corporation.  Then apply the second theme to the corporation category (you need allow theme assignment at the category level for this).

In reply to Rodrigo Ribeiro de Abreu

Re: squared theme 2.9 released

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Are the courses for each corporation in different categories (can they be) or are the users actually using the same courses but you want them to see different logos?

In the first instance either David or Emma's solutions will work - a different theme for each category, or a little bit of css that targets the categoryid in the body class, such as (Sorry, I don't have squared theme installed at the moment and I'm not on a computer with access to my moodle, so the example below is illustrative only and not the actual code for using in squared - I'll try and find that later if you cant find it using something like firebug, but the use of the categoryid class will allow you to target any css selector below, or including,  body with customisations for that particular corporation, so the exact css isn't necessarily relevant to the example)

.header logo {background: your_background_image_styles_css_for_default_look;}
.category-2 .header .logo {background: your_background_image_styles_css_for_corp1;}
.category-7 .header .logo {background: your_background_image_styles_css_for_corp2;}

If the latter, you may need to do some additional coding to make use of a user profile field that identifies the corporation the user works for and allows that to add a body class, then target the css using that rather than the category. You may also need to use this method if you want them to see their own corporation styling/logo on pages such as their own profile page which are not in any course or category.

You would add something like this in the early part of the relevant layout files

global $USER;
$bodyclasses = array();
if ($USER->institution == 'corp1' ) {$bodyclasses[] = 'corporationone';}
if ($USER->institution == 'corp2' ) {$bodyclasses[] = 'corporationtwo';}

Then the css would be something like

.corporationone .header .logo {background: your_background_image_styles_css_for_corp1;}
.corporationtwo .header .logo {background: your_background_image_styles_css_for_corp2;}
Hope that gives some help

Richard


Average of ratings: Useful (2)
In reply to Rodrigo Ribeiro de Abreu

Re: squared theme 2.9 released

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

I think the simple solution to this is to :

  1. create two categories.
    one to represent corp1
    one to represent corp2.
  2. Add courses to each category
  3. If using the Square theme then you need to have two
    child themes. I can make these for you no problem

When you have done all this and the themes are in place then all you need to do is to make sure you set each course to force theme/square_corp1 and theme/square_corp2 within their respective categories.

You will then be able to add a separate Logo to each theme.

This is how it was done in a school in China when I was working for a Moodle partner New School Learning. There they had six themes all the same but had different colours.

Hope this helps?

Mary

Average of ratings: Useful (1)
In reply to Mary Evans

Re: squared theme 2.9 released

by Rodrigo Ribeiro de Abreu -

Thank you all: David, Emma, Richard and Mary.

As a Webdesigner (and not the main developer here) I'm inclined to CSS solutions.

I'll try something like Richard Oelmann sugested.


Again, thanks a lot for dispending your time helping  me smile

In reply to Rodrigo Ribeiro de Abreu

Re: squared theme 2.9 released

by Rodrigo Ribeiro de Abreu -

I achieved it!

A colleague developer helped me in creating a query to find what category this user is.

To be able to do this, I need some premisses:

- An user (teacher or student) must be enroled in at least one course

- This course must be in an unique category

I did this, because I'm planning to use one instalation of moodle with many corporations (institution).


That's the query I put in general.php file, wich is inside the path /theme/squared/layout

$sql = "SELECT DISTINCT cat.name FROM {course_categories} cat INNER JOIN {course} c ON c.category = cat.id INNER JOIN {context} cx ON c.id = cx.instanceid INNER JOIN {role_assignments} ra ON cx.id = ra.contextid INNER JOIN {user} u ON ra.userid = u.id WHERE cx.contextlevel = '50' AND u.id = :userid;";
$params = array('userid' => $USER->id);


And I added the following lines

if ($userCategory == 'Clube de RH'){
    $bodyclasses [] = 'clubederh';   
} else if ($userCategory == 'Fagor'){
    $bodyclasses [] = 'fagor';   
} else if ($userCategory == 'Qualidade de Vida'){
    $bodyclasses [] = 'qualidadedevida';   
} else {$bodyclasses [] = 'padrao';    }

I've attached a screenshot of my file.

Attachment Screenshot_51.gif
In reply to Rodrigo Ribeiro de Abreu

Re: squared theme 2.9 released

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

In that case have you seen how IOMAD works?

It is based on Moodle but with added functionality for Multi Tennancy

Mary

In reply to Mary Evans

Re: squared theme 2.9 released

by Rodrigo Ribeiro de Abreu -

Although I used other solution, I was curious about this one.

Is it similar to wordpress, to create Moodle Child Themes?

If I have 30 Institutions/Corporations, I will need 30 child themes. Wouldn't this make my Moodle a bit more slow?


Thanks

In reply to Rodrigo Ribeiro de Abreu

Re: squared theme 2.9 released

by David Bogner -
Picture of Core developers Picture of Plugin developers

Hi Rodrigo,

try the campus theme. There you can have a different header for each institution. It was made exactly for cases like the one you describe. The only condition is, that you provide a top level course category for each of these institutions.

https://moodle.org/plugins/theme_campus

Kind regards,

David