I've had a quick look through some of the docs, and couldn't find the answer to this question:
What is inherited from parent theme in a daughter theme?
Everything? Nothing? Just what you decide? or . . .?
-Derek
I would have thought everything; idea of a child theme is to override certain elements/add to an existing theme isn't it?
Yes.
I believe you get everything from the parent unless you exclude it explicitly, like: https://github.com/gjb2048/moodle-theme_essential/blob/master/essentials/config.php#L33-L40.
Hello theme experts.
Thank you.
Just out of curiosity, what does https://tracker.moodle.org/browse/MDL-42961 mean?
A friend was looking at Decaf and we were thinking about child themes. He thought that not all inheritance was automatic if we went the daughter theme way.
-Derek
I think that MDL-42961 needs backing up with more evidence to justify the breakages specified in the bullet points.
However, the last is true as I've demonstrated in the 'Essentials' child theme of 'Essential': https://github.com/gjb2048/moodle-theme_essential/blob/master/essentials/lib.php#L26-L39 - but I've not tried to see if changing this: https://github.com/gjb2048/moodle-theme_essential/blob/master/essentials/config.php#L64 to the 'Essential' one would work.
Plus, the second bullet point is false: https://github.com/gjb2048/moodle-theme_essential/blob/master/essentials/config.php#L44-L61.
And indeed the third: https://github.com/gjb2048/moodle-theme_essential/blob/master/essentials/renderers/core_renderer.php and https://github.com/gjb2048/moodle-theme_essential/blob/master/essentials/renderers.php.
Thanks. I'll report back with our tests.
-Derek
The things inherited are all the parent's default settings, not the customisation.
As pointed out, the child theme is there to be not an identical copy, but as an individual with all the same features as the parent, but with the ability to change, otherwise it would just be a clone.
At the end of the day it depends what it is you want? A child (daughter) theme or a 'CLONE'.
Kind regards,
Mary
that tracker item is talking about settings, which are not inherited by child themes, see MDL-27280 for a related issue
Danny, if this MDL-27280 is still relevant, then what about updating the Fix Version?
-Derek
The 'Essentials' child theme of 'Essential' already implements the dead easy to do workaround: https://github.com/gjb2048/moodle-theme_essential/blob/master/essentials/lib.php#L26-L39 as the parent function is in the global scope. Yes, an array of functions for 'pre-processing' would be nice, but perhaps there should be a more object orientated approach as course formats have gone with 'format_base' in 'lib.php'. In which case it would be a simple matter of the child theme method calling the parent method when it overrode it. No need to check for function existence as 'duh' the parent class is already known about.
It looks like the parent only prettier...
Thanks for that Mary, after the day I had need a laugh ... and your post did the trick
You should try changing your avatar H...the one you have is a scream!
Almost sprayed the monitor with coffee just now