MOODLE 2.9 RC1: New changes to themes - Page Header

MOODLE 2.9 RC1: New changes to themes - Page Header

by Mary Evans -
Number of replies: 15
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Introduction

As most of you who are already following Moodle 2.9 Development in GitHub and Moodle Tracker, will be aware of the changes that are afoot in Bootstrapbase, Clean and More themes, however some of you will not. So this post and subsequent posts will hopefully highlight these changes.

Page Header

The page header in all Moodle Themes is the place where the page heading is seen. In Clean and More themes you can also upload a 'Logo' which is added as a background image using CSS and styled via the theme. The only draw back from this was that you lost the page heading.

In Moodle 2.9 this will be changed so that the 'Logo' if it is used will be displayed as usual, but also the 'page heading' too just below it.

That said...I am just testing this out and something is not working...

Leaving this post here and hope I can get back to it and report something positive!

Mary

Average of ratings: -
In reply to Mary Evans

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I am sure my theme is not a shining example of good coding but I separated them out.  Page heading shows up just above the main content of the page and then the logo is up with the breadcrumbs to the right.  

The logo actually appears where the Editing on and off button used to appear.  

I moved that button down by the content where it belongs for easy access for teachers.

In reply to Chris Kenniburg

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

That's fine in your Evolve-D theme Chris, because you have changed things around and it wont matter how you code it, it works. I'm concerned that the themes that people have made may want to experiment with the new code and find it does not work.

Cheers

Mary

In reply to Mary Evans

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

I've performed a structured walk through of the new header code and to be honest, I'm not a fan.  Its a tad messy and from an OO point of view embeds the functionality in the wrong place.  I have made some comments on the tracker issue already.

At the moment the header methods are embedded all the way down in the 'lib/outputrender.php' file which is used by 'base', 'bootstrapbase' and indeed all themes even if they don't have a parent - thus getting the methods whether they want it or not.  This is wrong as the code is 'Bootstrap' specific and thus should be in the overridden 'core_renderer.php' type file in the 'bootstrapbase' theme such that its not enforced on other themes that use other frameworks etc.

It also embeds Moodle even further entwined with Bootstrap and thus making it difficult to innovate and adapt to new and exciting frameworks.  So, Moodle will start to have the same sort of 'Yet another Wordpress' site recognition type thing - not that Wordpress is bad (I love it), just that variety is the spice of life.

Yes its a nice idea, but from the looks of things its just a 'style' decision and as such other contributed themes don't have to use it and will be fine without it.

In reply to Gareth J Barnard

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

Yeah...I am not a fan now that I cannot get the logo to show up in my theme, unless I revert back to having the page header and breadcrumb hard coded into the page rather than as an output from a renderer.

Have you seen the new classes directory in Clean theme that contains a core_renderer.php file? How can that work?

Worried

Mary

In reply to Mary Evans

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

by Derek Chirnside -

There are several types of themers.

  1. People active in the forums and doing stuff.  Sometimes great stuff.
  2. People not active in the forums and doing stuff
  3. Hackers.  Survivors.  
  4. Dabblers who are non-coders (me)
  5. Plus . . .

I note this today: http://www.moodlenews.com/2015/moodlerooms-releases-snap-theme-to-the-community/

Snap theme:

I'm be very interested to see if this does anything for my problem: the Moodle menu scroll of death

I actually still owe you guys an answer to the question What basics in a theme do you want?  With the comments in this thread I may make time to work on this.

All this to say (and I know I have said this sort of thing before) it troubles me that we are moving into 2.9 and some of the best coders in category 1 above are worried about the theme developments after the event (ie they are not a fan), when it is already implemented.  Has themeing become just too complex and chaotic?

I've spent the last 3 months in theme hell.  Moodle 2.8 installed and breaks my workflow (with the change from TinyMCE) and the only fix I can find (Videoeasy) clashes with my theme (Decaf).  So for the ONE course I need real beauty, I need to revert to clean for this to work. My fault of course: I've prioritised beautiful responsive navigation (awesome bar) above a few other things, and I've been bitten.  

Oh well.  Such is the life in OS.

-Derek

In reply to Derek Chirnside

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

Hi Derek,

I believe the following:

  • That themes are just one component of the user experience.  That other things like the navigation block and course formats have their part to play.
  • There are lots of different ways that people want Moodle to operate to suit them.  Thus there is never one size fits all.  So Awesomebar for some but not all etc.
  • I have become much more skilled in theme development, this shows in improvements to Shoelace and Essential along with the birth and early development of Shoehorn and Campus.  Thus my opinion has changed to be more positive and pragmatic.
  • That theming has not become too complex and chaotic, its just moved on to use newer technologies and methodologies.  My comments above are to do with one specific area that in reality is technically simple.
  • You can do far more radical things in contributed themes than in core quickly.  This is the right way as with contributed themes you get something new but comes with more risk.  With core themes you get plain stability to fall back upon when things don't quite work.  I fall back to using 'Clean' all of the time when developing and things break.  It is also a good benchmark in determining if an issue is theme specific or not.

If you have contributed plugins that conflict, then contact the appropriate developers and let them know.  99% of the time it is possible to create completely separated modules that don't conflict.  When conflicts do occur, then fixes can happen in either or both plugins.  Its a matter of being proactive, talking to the developers and helping them to help you.

Gareth

In reply to Derek Chirnside

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

No Derek, themes are not too complex or chaotic, it's just that Moodle is changing the way things have been done. Now we are really moving along at a great pace and the DEVs are working flat out. This in itself is exciting.

The initial reason for this post started off as a way of letting people who, like me want to know about the changes in Moodle 2,9. But as I began to write I stopped briefly to test these new changes and found, to my dismay, that my theme no longer worked the way it had if I emplyed the new code.

But still it is difficult to see if this particular change, to the way the page header is coded, is going to affect the way we code a theme generally. Of course we could just ignore it, and carry on as normal. But if we do, then a new breed of Moodle theme may evolve, in such a way that may hinder our progress rather than enhance it.

For instance; a web designer might want to layout a page in a specific way, and then find that there are elements, within the structure of that page, that are coded in such a way they are difficult to separate and use singularly, because of the different way in which they are coded now.

To me it looks like the Moodle Developers employed to update Moodle, and bringing with it new and exciting building blocks for Theme Designers to use, are themselves finding that Theme design is not easy and that some of the code, that we have been used to and familiar with, was not right and so are changing it.

At the end of the day, I am perhaps worrying about nothing.

Cheers

Mary

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

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

by Damyon Wiese -
Just pasting the lastest version of the notes in theme/upgrade.txt (only recently updated)

* Themes Clean amd More page header background logo, if loaded, no longer links to the home page.
* Themes Clean and More have been updated to use the renderer full_header(). This renderer (when in a user context) displays a message button
and consequently the link to message users have been removed from various pages. It is recommended that theme developers use this
renderer to ensure that they do not suffer from a reduction in access to this feature.
* $OUTPUT->context_header() has been introduced to produce headers similar to what full_header() creates. This renderer is used for creating
subsequent headers in a page. If provided with user information, this render will also display a message button like full_header().

Summary - if you don't change anything nothing will break, you will just miss out on the extra button to message a user directly from the header. If you want that feature, switch to using full_header (and use clean as an example).
In reply to Damyon Wiese

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

Interesting Damyon, thank you.

Looking at the code there does not appear to be any purpose to the 'headinglevel' parameter on the 'context_header' method, please could you explain this.

In reply to Mary Evans

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

Hi Mary,

I've not seen them, but I believe from your description that it would be 'class autoloading'.  To learn about that, please have a look at the January 2015 developers meeting.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

P.S. With 'autoloading' I've just tried in Shoelace and could not make it work when I add extra methods to the class.  I get an error pertaining to non-existence of the method in the base class.

In reply to Gareth J Barnard

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

Whata mistakea to makea!  With TDM off need to 'Purge all caches' when implementing 'Autoloading'.

In reply to Gareth J Barnard

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

I still cannot get my Logo to appear in my Morecandy theme which is much altered from the one in the Plugins DB.

Also, I do not like the way the 'Breadcrumb' and 'Page header' are all been lumped together in...

<?php echo $OUTPUT->full_header(); ?>
In reply to Mary Evans

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

Re: MOODLE 2.9 RC1: New changes to themes - Page Header

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

Thanks I may have a go at that.

Just reading your other renderers and wondered what sparrows had to do with blocks! Then I realised I was reading it wrognly! LOL My dyslexic.