I have moodle 3.8.2+ and moove theme.
I want a child theme to use as a way to overrider a renderer in a category and courses in that category, and leave everything else the same - e.g still apply the parent themes settings, custom scss, icons, logos, use the parent layouts, templates, etc. The child theme would not have its own stylesheet or settings.
(Incidentally, what is $THEME->hidefromselector property for? I imagined it would hide it from the theme selector only but it actually hides it from both the theme selector AND the drop-downs such as on the edit category page. I guess it must be for hiding parent themes?)
I know how to write the overridden renderer and have tested that part - that bit is fine. The child theme doesn't seem to be applying the parents colours, logo, or custom scss. What else is needed?
In config.php I have
defined('MOODLE_INTERNAL') || die(); require_once(__DIR__ . '/lib.php'); $THEME->name = 'moovechild'; $THEME->parents = ['moove','boost']; $THEME->rendererfactory = 'theme_overridden_renderer_factory'; $THEME->sheets = []; $THEME->editor_sheets = []; $THEME->enable_dock = false; $THEME->yuicssmodules = array(); $THEME->requiredblocks = ''; $THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV; $THEME->scss = function($theme) { $parentconfig = theme_config::load('moove'); return theme_moove_get_main_scss_content($parentconfig); }; $THEME->prescsscallback = 'theme_moovechild_get_pre_scss'; $THEME->extrascsscallback = 'theme_moovechild_get_extra_scss'; $THEME->iconsystem = '\theme_moove\util\icon_system';
In lib.php I have
defined('MOODLE_INTERNAL') || die(); function theme_moovechild_get_pre_scss($theme) { $theme = theme_config::load('moove'); return theme_moove_get_pre_scss($theme); } function theme_moovechild_get_extra_scss($theme) { $theme = theme_config::load('moove'); return theme_moove_get_extra_scss($theme); }