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.

2) The minimum files/folders you require to create a child theme are: config.php, version.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) 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.
$THEME->name='test'; // Name of the theme
$THEME->sheets=array("); // Stylesheets for the theme
$THEME->parents=['boost']; // Parent Theme
$THEME->javascripts=array("); //JS Files for the theme

6) 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)

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

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

9) 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*/

In this example, I have used Boost theme. However, this code works with every other theme such as Edwiser RemUI, Lambda, Adaptable, Clean and other Moodle themes.

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