(Miss)understanding moodle 3.5 boost changes?

(Miss)understanding moodle 3.5 boost changes?

by Antonio Beermann -
Number of replies: 5

Hi,

with the great support of this forum I managed to build a nice child AND a child-child theme for moodle 3.4.

The main reason is, the child theme gets all the locallib stuff (not done by me) and the child-dhild themes just make some small color changes.

It uses boost from 3.4 and just has changes in it where needed. It loads template and SCSS from boost first and than adds all other stuff.


I have troubles to convert it to moodle 3.5 within the following points:


- SCSS loading (and working - some changes seems not to be working (even within the same file!?)

- templates not loading (code parts added are just not there, wrong references to main theme?)

I digged around for weeks, read I guess all the topics from Mary, Richard, ... all links in the moodle docs (https://docs.moodle.org/dev/Updating_a_boost_based_theme), but it seems that most child themes for moodle 3.5 copy boost into their theme!? Which is not the way I would like to do, to prevent sticking with old files on updates.

I do not mind the changes in classes and that stuff (I think I understand that part wink)

This is my moodle 3.4 lib.php (just the main parts)


function theme_moodle_child-child_get_main_scss_content($theme) {

    global $CFG;


    $scss = '';

    $filename = !empty($theme->settings->preset) ? $theme->settings->preset : null;

    $fs = get_file_storage();


    $context = context_system::instance();


$scss .= file_get_contents($CFG->dirroot . '/theme/childtheme/scss/preset/default.scss');

$scss .= file_get_contents($CFG->dirroot . '/theme/child-childtheme/scss/preset/default.scss');

$scss .= file_get_contents($CFG->dirroot . '/theme/childtheme/scss/preset/layout.scss');

$scss .= file_get_contents($CFG->dirroot . '/theme/child-childtheme/scss/preset/layout.scss');

$scss .= file_get_contents($CFG->dirroot . '/theme/child-childtheme/scss/preset/post.scss');


    return $scss;

How would this look like for moodle 3.5 and the new boost?

best regards!

Antonio


Average of ratings: -
In reply to Antonio Beermann

Re: (Miss)understanding moodle 3.5 boost changes?

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

My Waxed and HandleBar themes do not copy Boost and I have created child themes for Waxed for my own development and testing too.

However, you do need to consider that Boost had MAJOR changes between Moodle3.4 and Moodle3.5 with the move to Bootstrap4Stable. That means output/classes, lib file, and templates have changed, as well as the SCSS files themselves.

Without knowing what is in your locallib file, I would generally say that its not too difficult to adjust your theme between 3.4 and 3.5 (Bas did some great work there) - Chris Kenniburg (Fordson) and myself (Waxed and Handlebar) both did it (as I'm sure did many others), with some collaboration but not too many problems which were shared in one of the forum threads about the time 3.5 came out.


It does sound as if your main issues are the need to update your template files or the output classes calling them, and your SCSS files. TBH with the SCSS files, I started from scratch with a new set of bootswatch files and re-added my own changes to it.

Average of ratings: Useful (1)
In reply to Antonio Beermann

Re: (Miss)understanding moodle 3.5 boost changes?

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

Antonio,

Updating from Moodle 3.4 to 3.5 was a bit scary for me as well.  I had posting some concerns about it and you can follow the solutions over on this thread.  Bas and the community was a big help.  There is a trick to the SCSS.  Be sure to see Bas's reply.

https://moodle.org/mod/forum/discuss.php?d=370088

Average of ratings: Useful (1)
In reply to Antonio Beermann

Re: (Miss)understanding moodle 3.5 boost changes?

by Antonio Beermann -

Thank you for your answers!

I allready had a look into the link you posted (allready read this some weeks ago) I will definitly reread it tomorrow with a fresh espresso smile

And I allready tried to start from scratch - without success.

Also downloaded your themes (wax/fordson) and tried to make a guess on it.

The problem is that my variables seem to be ignored (some), I allready cleared out all errormessages and unknown variables.


Is there any documentation which .SCSS files are processed or loaded in what order and which one relies on another?

I still can't get my head around which files to put in my boost child-theme - just want to load a fixed presetfile.

best regards

Antonio

In reply to Antonio Beermann

Re: (Miss)understanding moodle 3.5 boost changes?

by Antonio Beermann -

So I took another day for reading/checking/testing and I found the following reason for my theme which prevented a general upgrade to get it work in 3.5:

I just had to remove the "!default" from my own variables

The strange thing for me is, that I thought this shouldn't be necessary anyway, but my 3.4 theme version doesn't work without it.

So now at least I can start doing the real work and recode my CSS wink

Thank's a lot for the time to answer

best regards

Antonio

If someone has technical input on this for me I would be happy - I guess there are reasons for this behaviour smile 

In reply to Antonio Beermann

Re: (Miss)understanding moodle 3.5 boost changes?

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

Antonio, 

You need to compare any HTML which contain CSS class selectors in the layout files and templates of the new Boost 3.5 theme, as this would be a starting point for me in order to understand Bootdtrap 4, as it is very different than the other Bootstrap versions which we all have had experience with.

Hope this helps?

Mary