How to create a Child theme in Edwiser RemUI theme?

You can create a child theme and then change the style of the moodle view by modifying the CSS.

1) You need to start by logging onto your Moodle server, heading over to ‘theme’ folder and creating a folder for your theme name under it. The name of the folder should be the same as the name of the child theme. 

In this example, we are naming the child theme as theme_test

2) The minimum files/folders you require to create a child theme are: config.php, version.php, lib.php and lang/en/theme_{{ name_of_child_theme }}.php, For eg. theme_test.php.

3) In the version file, you’ll have to specify the theme version ($plugin->version), the required Moodle version ($plugin->requires) and the name of the theme ($plugin->component)

4) define('MOODLE_INTERNAL') || die;
$plugin->version = 2018010200; // Y/M/D Format for minimum moodle version
$plugin->requires = 2017051500; // Y/M/D Format for minimum theme version
$plugin->component = 'theme_test'; // Replace test by name of your theme

5) Now, copy lib.php from theme/remui/ to theme/theme_test and delete all the function from the copied lib.php file except theme_remui_process_css() function

6)Rename theme_remui_process_css to theme_test_process_css()

7) The config.php file specifies the configuration of the theme. Since this is a child theme, you need to specify the parent theme’s name in the config 

file.require_once(__DIR__ . '/lib.php');

// $THEME->doctype='html5';

$THEME->name = 'theme_test';
$THEME->sheets = [];
$THEME->parents = ['remui'];
$THEME->enable_dock = false;
$THEME->yuicssmodules = array();
$THEME->javascripts = array("");
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
$THEME->csspostprocess = 'theme_test_process_css';
$THEME->requiredblocks = "";
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
$THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;

8) In Moodle LMS, all the strings used in the theme are generally stored in one file which is named as theme_{{name_of_theme}.php. The default location of this file is {{ your_theme_directory }}/lang/en. (es for Spanish, fr for French and de for German)

9) defined('MOODLE_INTERNAL') || die();
$string['pluginname']='Test';
$string['choosereadme']='Theme Test is a child theme of Boost.';

10) Now install your theme, by upgrading the database. Change the theme to your currently installed theme from ‘Theme Selector Option’.

11) To add your custom styling, you’ll have to create a ‘.css’ file under ‘style’ folder and add it to the config file.
$THEME->sheets=array(‘teststyle’); // Replace teststyle by name of your stylesheet

Styling your Moodle Theme
Your Moodle theme can be styled as per your preference by overriding certain styles from the parent theme.
For example, if you want to set the color of text headings, you could add the following to the stylesheet.
h1, h2, h3, h4, h5, h6 {
color: #333; /*your color here*/
}

To change the link color
Here’s what you can add:
a {
color: #333; /*your color here*/
}

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us