Custom menus - sub-menus breaking in Bootstrap based themes

Custom menus - sub-menus breaking in Bootstrap based themes

by Gareth J Barnard -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi all,

I've fixed this in MDL-41788.  For the most part all you need to do is update your Moodle core - being M2.5, 2.6 or 'master'.  If however you build your own 'moodle.css' then you'll need to update it - so for instance in Shoelace or Mutant Banjo - https://github.com/gjb2048/moodle-theme_shoelace/tree/master/less there is instructions in the readme file.  This is because there is an adapted CSS style.

The specific changes can be viewed by looking at: https://github.com/gjb2048/moodle/commit/997731210cc0ce95c47fdea057e878fd4fea5a00.  Which in essence adds a new CSS selector 'langmenu' and has the bootstrapbase renderer output it.  The class member attribute '$language' is a way of passing around an instance of 'custom_menu_item' without changing the parameter specification of the methods and causing a regression.  Therefore if you wish to patch the code in your own theme then this should work for earlier versions of Moodle as long as you add the CSS somehow.

Cheers,

Gareth

Average of ratings: Useful (1)