Is it possible to create Fordson child theme?

Is it possible to create Fordson child theme?

by Sara Cenni -
Number of replies: 1

Hi, I would like to create a Fordson child theme, because I need to use some different renderers.

I followed the instructions https://docs.moodle.org/dev/Creating_a_theme_based_on_boost so I created a new theme “Dummy” that extends Fordson adding this code in config.php

$THEME->parents = array(

     'boost',

     'fordson',

);

Then, in the lib.php, I rewrote these 3 functions and I copied in theme_dummy_get_main_scss_content the content of the fordson function.

function theme_dummy_get_pre_scss($theme) {

    $theme = theme_config::load('dummy');

    return theme_boost_get_pre_scss($theme);

}

function theme_dummy_get_extra_scss($theme) {

    $theme = theme_config::load('dummy');

    return theme_fordson_get_extra_scss($theme);

}

function theme_dummy_css_tree_post_processor($tree, $theme) {

    $prefixer = new theme_boost\autoprefixer($tree);

    $prefixer->prefix();

}

I also copied settings file and directory.

My theme isn’t working properly because some parts of pages look like boost page.


 

Is it possible to extend fordson theme or it easier to copy it and change the copied theme?

Thanks!


Average of ratings: -