Hey Moodle theme devs!
I'm working with Moodle 2.9.1 primarily, but possibly also Moodle 2.7.x.
I'm starting a new theme project that may end up being the base for multiple client themes.
In the past I've just cloned my base theme and made any modifications as necessary, this doesn't seem like an optimal way to maintain the base theme and be able to push updates to the base while leaving any client overrides intact.
This is where I believe Moodles dependencies come into play.
If I understand these correctly any plugin can have a dependency on another defined in the config like so:
$plugin->dependencies = array(
'theme_bootstrapbase' => 2015050500,
'theme_clean' => 2015051100,
On its own all this does is check whether the following plugins are installed and have a minimum version.
Then within our theme we can declare the parent themes like so:
$THEME->parents = array('bootstrapbase', 'clean');
How does this parents list work?
For example the first parent has it's config file load, following by the second parent and then finally the current themes configuration, with any re-declarations overriding the previous?
I'm interested in whether my understanding of this is correct and how extensive the inheritance is?
If my new theme does not declare a layout for the frontpage, but the second parent does than will that layout be used?
I've seen a command to exclude specific css sheets from any given parent so I assume all css used by the parent is inherited by default and any rules that conflict will be resolved by load order.
Are settings inherited from parent to child themes?
Are resources from a parent theme usable by children themes? i.e the pix folder
If anyone has an understanding of theme dependencies / inheritance or an example of how to set one up I would be very interested to have a chat regarding it.
My plan as I see it is to either modify the clean / more theme provided in moodle core OR have a new theme dependent on one of them that will act as my base, then whenever I need a client specific theme I will simply say that it is dependent on my new base.
This would allow my base to accept updates from clean / more and my client themes to accept updates to my base as I improve it moving forward.