{"id":13227,"date":"2020-01-16T00:00:00","date_gmt":"2020-01-15T23:00:00","guid":{"rendered":"https:\/\/tresipunt.com\/create-a-moodle-child-theme\/"},"modified":"2026-12-03T14:14:43","modified_gmt":"2026-12-03T13:14:43","slug":"create-a-moodle-child-theme","status":"publish","type":"post","link":"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/","title":{"rendered":"Create a Moodle Child Theme"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_91 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#What_a_Moodle_child_theme_is\" >What a Moodle child theme is<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Why_use_a_child_theme_instead_of_modifying_the_theme_or_building_your_own\" >Why use a child theme instead of modifying the theme or building your own<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#What_you_can_customize_with_a_Moodle_child_theme\" >What you can customize with a Moodle child theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#What_a_child_theme_inherits_from_its_parent_theme\" >What a child theme inherits from its parent theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Minimum_structure_of_a_Boost_child_theme\" >Minimum structure of a Boost child theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_create_a_Boost_child_theme_step_by_step\" >How to create a Boost child theme step by step<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Shortcut_3ipunts_child_theme_template\" >Shortcut: 3ipunt&#8217;s child theme template<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_customize_the_child_theme_styles_templates_layouts_and_renderers\" >How to customize the child theme: styles, templates, layouts and renderers<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_add_your_own_styles\" >How to add your own styles<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_override_a_Mustache_template\" >How to override a Mustache template<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_pass_data_to_a_template_with_a_layout\" >How to pass data to a template with a layout<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_override_a_renderer\" >How to override a renderer<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_maintain_a_child_theme_when_Moodle_is_updated\" >How to maintain a child theme when Moodle is updated<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#A_child_theme_can_also_patch_the_parent\" >A child theme can also patch the parent<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Common_mistakes_when_creating_a_Moodle_child_theme\" >Common mistakes when creating a Moodle child theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_to_customize_your_Moodle_without_starting_from_scratch\" >How to customize your Moodle without starting from scratch<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Frequently_asked_questions_about_Moodle_child_themes\" >Frequently asked questions about Moodle child themes<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Whats_the_difference_between_a_theme_and_a_child_theme_in_Moodle\" >What&#8217;s the difference between a theme and a child theme in Moodle?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Which_theme_should_the_child_theme_be_based_on\" >Which theme should the child theme be based on?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Do_I_lose_my_child_theme_when_I_update_Moodle\" >Do I lose my child theme when I update Moodle?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Do_I_need_to_know_how_to_code_to_create_a_child_theme\" >Do I need to know how to code to create a child theme?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#Can_I_create_a_child_theme_of_another_child_theme\" >Can I create a child theme of another child theme?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/tresipunt.com\/en\/create-a-moodle-child-theme\/#How_do_I_temporarily_hide_a_child_theme_that_has_errors\" >How do I temporarily hide a child theme that has errors?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p class=\"wp-block-paragraph\">Here is the video of the presentation our colleague <a href=\"https:\/\/tresipunt.com\/en\/team\/\">Roser<\/a> gave the other day at our offices on how to create a Moodle child theme.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Crea un child theme de Moodle y no te quedes atr\u00e1s con las nuevas versiones\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/LwNJoVGlMsQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In this workshop we&#8217;ll learn what a child theme is and why it matters for developing and customizing any <a href=\"https:\/\/moodle.com\/\" target=\"_blank\" rel=\"noopener\">Moodle<\/a> site, especially its look and feel. We&#8217;ll explain what kinds of customizations a child theme allows and touch on the basics of inheritance from the parent theme. Finally, a short hands-on workshop will show how to create a child theme of the Classic theme.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A <strong>Moodle child theme<\/strong> is a custom theme that inherits styles, templates, layouts and renderers from a parent theme, usually Boost, and contains only the changes you want to make. It lets you customize Moodle&#8217;s appearance without touching the original theme&#8217;s code, so you can update Moodle and the parent theme without losing your customizations.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it is:<\/strong> a theme-type plugin that declares another theme as its parent in its <code>config.php<\/code>.<\/li>\n\n\n<li><strong>What it&#8217;s for:<\/strong> changing colors, login, header, footer, front page, icons or activity views without building a theme from scratch.<\/li>\n\n\n<li><strong>Minimum files:<\/strong> <code>version.php<\/code>, <code>config.php<\/code>, <code>lib.php<\/code>, language files and the <code>favicon<\/code> and <code>screenshot<\/code> images.<\/li>\n\n\n<li><strong>Four techniques:<\/strong> stylesheets, Mustache templates, layouts and renderers, from least to most complex.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_a_Moodle_child_theme_is\"><\/span>What a Moodle child theme is<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A child theme is a Moodle theme that depends on another one. When you create it, it&#8217;s almost an empty shell: it inherits the parent&#8217;s styles, templates, page layouts, icon system and part of its configuration, so when you activate it the platform looks practically the same. From there, you only add the files that change something.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since it&#8217;s a plugin in its own right, the child theme has its own language strings and can have its own settings, although at first it has none. It&#8217;s used when the parent theme falls short on some requirement and you want to make specific customizations while letting the parent handle everything else.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_use_a_child_theme_instead_of_modifying_the_theme_or_building_your_own\"><\/span>Why use a child theme instead of modifying the theme or building your own<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are three ways to change Moodle&#8217;s appearance, and only one combines flexibility with safe updates:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Option<\/th><th>Initial cost<\/th><th>Updates<\/th><th>Maintenance<\/th><\/tr><\/thead><tbody><tr><th>Editing the parent theme directly<\/th><td>Very low<\/td><td>Every update wipes out your changes<\/td><td>High and unpredictable<\/td><\/tr><tr><th>Child theme<\/th><td>Low to medium<\/td><td>The parent updates on its own; you review your overridden files<\/td><td>Proportional to what you override<\/td><\/tr><tr><th>Custom theme from scratch<\/th><td>Very high<\/td><td>Everything is up to you<\/td><td>High: you maintain the whole theme<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Conclusion: a child theme separates the core code from your modifications, which is good development practice, and avoids touching the Moodle core and the theme itself. A small amount of style and structure code delivers a lot of visual value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_you_can_customize_with_a_Moodle_child_theme\"><\/span>What you can customize with a Moodle child theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With a child theme you can change almost all of Moodle&#8217;s visual layer. The most requested customizations are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Login page:<\/strong> custom background, colors and text, such as the contact email or legal notice.<\/li>\n\n\n<li><strong>Activity icons:<\/strong> replacing the images with ones that match the brand&#8217;s visual style; the change applies across the whole platform.<\/li>\n\n\n<li><strong>Header, footer and menus:<\/strong> custom logos, text, links and icons.<\/li>\n\n\n<li><strong>Front page:<\/strong> sliders, featured blocks, videos or course categories with different designs.<\/li>\n\n\n<li><strong>General styles:<\/strong> typography, colors, buttons, cards and borders.<\/li>\n\n\n<li><strong>Activity views:<\/strong> for example, a quiz redesigned to be more pleasant during long sessions.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In 3ipunt projects, child themes have been used for everything from branded login pages to front pages with sliders and course categories with different formats and enrollment methods, or a completely redesigned quiz. When the front page needs a lot of dynamic data, the child theme is combined with additional development.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_a_child_theme_inherits_from_its_parent_theme\"><\/span>What a child theme inherits from its parent theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A child theme inherits six elements from its parent:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Styles:<\/strong> the parent&#8217;s compiled CSS or SCSS.<\/li>\n\n\n<li><strong>Mustache templates:<\/strong> the HTML structure of each component.<\/li>\n\n\n<li><strong>Layouts:<\/strong> the PHP files that prepare the data for each page type.<\/li>\n\n\n<li><strong>Icon system:<\/strong> the icons for activities, plugins and navigation.<\/li>\n\n\n<li><strong>Renderers:<\/strong> the classes that generate the output of Moodle and its components.<\/li>\n\n\n<li><strong>Part of the configuration:<\/strong> not all of it; settings the administrator set on the parent, such as Boost&#8217;s brand color, don&#8217;t automatically apply to the child.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If you want the child to respect those parent settings or to chain configurations (child, parent, grandparent), you need to code more advanced inheritance in <code>lib.php<\/code>. It&#8217;s possible, but every link in the chain adds maintenance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Minimum_structure_of_a_Boost_child_theme\"><\/span>Minimum structure of a Boost child theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A working child theme needs these files inside <code>theme\/[name]<\/code>. In Moodle 5.1 and later, plugins live inside the <code>public\/<\/code> folder, so the path is <code>public\/theme\/[name]<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>File or folder<\/th><th>Required<\/th><th>What it&#8217;s for<\/th><\/tr><\/thead><tbody><tr><th><code>version.php<\/code><\/th><td>Yes<\/td><td>Plugin version, minimum Moodle version, component and parent theme dependency<\/td><\/tr><tr><th><code>config.php<\/code><\/th><td>Yes<\/td><td>Theme name, parent theme, stylesheets and renderer factory<\/td><\/tr><tr><th><code>lib.php<\/code><\/th><td>Yes (can be empty)<\/td><td>Moodle callbacks: SCSS, navigation, advanced inheritance<\/td><\/tr><tr><th><code>lang\/xx\/theme_[name].php<\/code><\/th><td>Yes<\/td><td>Theme strings in each language<\/td><\/tr><tr><th><code>pix\/favicon.ico<\/code> and <code>pix\/screenshot.png<\/code><\/th><td>Yes<\/td><td>Browser tab icon and theme selector image<\/td><\/tr><tr><th><code>style\/<\/code> or <code>scss\/<\/code><\/th><td>No<\/td><td>Custom styles<\/td><\/tr><tr><th><code>templates\/<\/code><\/th><td>No<\/td><td>Overridden or new Mustache templates<\/td><\/tr><tr><th><code>layout\/<\/code><\/th><td>No<\/td><td>Overridden layouts<\/td><\/tr><tr><th><code>classes\/output\/<\/code> or <code>renderers.php<\/code><\/th><td>No<\/td><td>Overridden renderers<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_create_a_Boost_child_theme_step_by_step\"><\/span>How to create a Boost child theme step by step<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Creating a basic Boost child theme takes less than an hour if you follow this order:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Choose the short name:<\/strong> lowercase only and no spaces, for example <code>myboost<\/code>. It will be the folder name, the component identifier (<code>theme_myboost<\/code>) and the value of <code>$THEME-&gt;name<\/code>; all three must match.<\/li>\n\n\n<li><strong>Create the folder<\/strong> <code>theme\/myboost<\/code> (or <code>public\/theme\/myboost<\/code> in Moodle 5.1+).<\/li>\n\n\n<li><strong>Create <code>version.php<\/code><\/strong> with the Boost dependency. Copy the value of <code>$plugin-&gt;version<\/code> from the Boost <code>version.php<\/code> in your installation.<\/li>\n\n\n<li><strong>Add the language files<\/strong> in <code>lang\/en\/theme_myboost.php<\/code> (and in every language you need) with at least <code>pluginname<\/code>, <code>choosereadme<\/code> and <code>configtitle<\/code>.<\/li>\n\n\n<li><strong>Create <code>config.php<\/code><\/strong> declaring Boost as the parent.<\/li>\n\n\n<li><strong>Create <code>lib.php<\/code><\/strong>, even if it stays empty for now.<\/li>\n\n\n<li><strong>Add <code>pix\/favicon.ico<\/code> and <code>pix\/screenshot.png<\/code>;<\/strong> at first you can reuse Boost&#8217;s screenshot.<\/li>\n\n\n<li><strong>Install the theme<\/strong> from <em>Site administration \u2192 Notifications<\/em> and select it under <em>Appearance \u2192 Themes<\/em>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A minimal <code>version.php<\/code> looks like this (the numbers are examples):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php<br>defined('MOODLE_INTERNAL') || die();<br><br>$plugin-&gt;version   = 2026112400;<br>$plugin-&gt;requires  = 2025100600;        \/\/ Minimum Moodle version.<br>$plugin-&gt;component = 'theme_myboost';<br>$plugin-&gt;dependencies = [<br>    'theme_boost' =&gt; 2025100600,        \/\/ Boost version in your installation.<br>];<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And a basic <code>config.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php<br>defined('MOODLE_INTERNAL') || die();<br><br>$THEME-&gt;name = 'myboost';<br>$THEME-&gt;parents = ['boost'];<br>$THEME-&gt;sheets = ['custom'];            \/\/ Loads style\/custom.css.<br>$THEME-&gt;editor_sheets = [];<br>$THEME-&gt;yuicssmodules = [];<br>$THEME-&gt;rendererfactory = 'theme_overridden_renderer_factory';<br>$THEME-&gt;requiredblocks = '';<br>$THEME-&gt;addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;<br>$THEME-&gt;hidefromselector = false;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each line has a specific purpose:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>parents<\/code>:<\/strong> the most important line. Without it, the theme is an empty shell that inherits nothing. It accepts several parents: a Classic child needs <code>['boost', 'classic']<\/code>, because Classic uses layouts from both.<\/li>\n\n\n<li><strong><code>rendererfactory<\/code>:<\/strong> allows your renderers to replace Moodle&#8217;s.<\/li>\n\n\n<li><strong><code>hidefromselector<\/code>:<\/strong> if you set it to <code>true<\/code>, the theme no longer appears in the site, category and course selectors. It&#8217;s useful for pulling it temporarily if you spot a problem in production.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Before signing off on the theme, compare your <code>config.php<\/code> with Boost&#8217;s for your version: Moodle 4.x added settings such as <code>haseditswitch<\/code> or <code>usescourseindex<\/code> that are worth reviewing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Shortcut_3ipunts_child_theme_template\"><\/span>Shortcut: 3ipunt&#8217;s child theme template<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ve published the <a href=\"https:\/\/github.com\/3iPunt\/boostchildtemplate\" target=\"_blank\" rel=\"noopener\"><strong>boostchildtemplate<\/strong><\/a> on GitHub with all the minimum files. To use it, you only need three changes:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Find and replace <code>NAME<\/code> with the theme&#8217;s display name and <code>PACKAGECODE<\/code> with the short name.<\/li>\n\n\n<li>Rename the language files to <code>theme_[short name].php<\/code> in each <code>lang<\/code> folder.<\/li>\n\n\n<li>Check that the theme folder has the same name as the short name.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The template was created for Moodle 3.8: update the numbers in <code>version.php<\/code> and review <code>config.php<\/code> before using it on a current version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_customize_the_child_theme_styles_templates_layouts_and_renderers\"><\/span>How to customize the child theme: styles, templates, layouts and renderers<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With these four techniques you can change almost any part of Moodle without touching core code. The golden rule is to always use the parent theme as a reference: anything the parent does, the child can do too by replicating the same folder structure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_add_your_own_styles\"><\/span>How to add your own styles<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a <code>style\/<\/code> folder in the child theme, add a file such as <code>custom.css<\/code> and include it in <code>$THEME-&gt;sheets<\/code> without the extension. Moodle loads it on every page where the theme is active. For projects with lots of styles, it&#8217;s better to work with SCSS through the <code>lib.php<\/code> callbacks, which lets you use Bootstrap variables and keep Boost&#8217;s brand settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moodle caches themes. While you develop, turn on theme designer mode or purge the caches after each change, and don&#8217;t leave designer mode on in production because it slows the platform down.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_override_a_Mustache_template\"><\/span>How to override a Mustache template<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To change a component&#8217;s HTML, copy its template into the child theme inside a folder named after the source component: <code>templates\/theme_boost\/<\/code> for Boost templates, <code>templates\/core\/<\/code> for core templates or <code>templates\/mod_quiz\/<\/code> for quiz templates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, to modify Boost&#8217;s main layout in Moodle 4.x and 5.x, copy <code>theme\/boost\/templates\/drawers.mustache<\/code> to <code>theme\/myboost\/templates\/theme_boost\/drawers.mustache<\/code> and edit the copy. If you put the file directly in <code>templates\/<\/code>, without the component folder, Moodle will keep using the parent&#8217;s.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The theme&#8217;s own templates, which don&#8217;t override anything, go directly inside <code>templates\/<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_pass_data_to_a_template_with_a_layout\"><\/span>How to pass data to a template with a layout<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Templates only display the data they receive. To pass a new piece of data, such as a text from the settings or the site name, copy the corresponding Boost layout (for example, <code>layout\/drawers.php<\/code>) to your theme&#8217;s <code>layout\/<\/code> folder and add the variable to <code>$templatecontext<\/code>. Unlike templates, layouts don&#8217;t need the component subfolder: Moodle looks in the active theme first.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep the scope in mind: the <code>drawers<\/code> layout is used on almost every Moodle page (course, activities, administration, front page). A change there will show up across the whole platform. To limit it to the front page, pass a variable to the context that indicates the page type and use a condition in the template.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_override_a_renderer\"><\/span>How to override a renderer<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When the change affects a specific area generated by PHP, the most precise option is to override the renderer that draws it. You create a class in the child theme that extends the original renderer, with the prefix <code>theme_[name]_<\/code> (or in <code>classes\/output\/<\/code> with the theme&#8217;s namespace), and copy into it only the method you want to change.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php<br>defined('MOODLE_INTERNAL') || die();<br><br>require_once($CFG-&gt;dirroot . '\/course\/renderer.php');<br><br>class theme_myboost_core_course_renderer extends core_course_renderer {<br>    \/\/ Copy here the method that draws the area you want to change<br>    \/\/ and modify its output.<br>}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The hard part is finding the exact method that generates what you see, but the result only affects that output and not every page.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Technique<\/th><th>What it changes<\/th><th>Scope<\/th><th>Difficulty<\/th><\/tr><\/thead><tbody><tr><th>Stylesheet<\/th><td>Visual appearance<\/td><td>The selectors you define<\/td><td>Low<\/td><\/tr><tr><th>Mustache template<\/th><td>Static HTML structure<\/td><td>Everything that uses that template<\/td><td>Low to medium<\/td><\/tr><tr><th>Layout<\/th><td>Data passed to the template<\/td><td>Every page using that layout<\/td><td>Medium<\/td><\/tr><tr><th>Renderer<\/th><td>Output generated by PHP<\/td><td>Only the overridden method<\/td><td>Medium to high<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_maintain_a_child_theme_when_Moodle_is_updated\"><\/span>How to maintain a child theme when Moodle is updated<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The advantage of a child theme is that the parent can be updated safely. The catch is that you maintain your child theme, and the work is proportional to what you&#8217;ve overridden. With each update, it&#8217;s worth following four steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Compare each overridden file<\/strong> (templates, layouts, renderers) with its new version in the parent. If the original has changed a lot, start from the new version and reapply your snippets.<\/li>\n\n\n<li><strong>Review the CSS classes<\/strong> your styles use. Moodle 5.0 upgraded Bootstrap to version 5, and some Bootstrap 4 classes changed.<\/li>\n\n\n<li><strong>Update the dependency<\/strong> in <code>version.php<\/code> to the parent version you&#8217;ve tested. That way you&#8217;ll know which combination works if something breaks.<\/li>\n\n\n<li><strong>Keep a stable version of the theme<\/strong> before adapting the next one.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Major jumps, such as the move from Moodle 3.x to 4.0, when Boost replaced <code>columns2<\/code> with <code>drawers<\/code>, force you to redo layout overrides. If you need to plan one of these upgrades, our experience <a href=\"https:\/\/tresipunt.com\/en\/successful-upgrade-to-moodle-lms-4\/\"><strong>upgrading to Moodle 4 without downtime<\/strong><\/a> and our overview of <a href=\"https:\/\/tresipunt.com\/en\/moodle-5-3-all-the-new-features-in-the-new-lts-version\/\"><strong>what&#8217;s new in Moodle 5.3<\/strong><\/a> may help.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same applies to themes that already inherit from Boost, such as Adaptable: you can create a child of them by setting that theme as the parent and its version as the dependency. Each level in the chain is one more theme to review when updating.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"A_child_theme_can_also_patch_the_parent\"><\/span>A child theme can also patch the parent<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">At the 3ipunt workshop, Roser Prua\u00f1o explained a lesser-known use. When a third-party parent theme had a bug in its icons, the team fixed it in the child theme by overriding only the affected part. The platform worked fine while the author released the fix, without touching their code or blocking their updates. In other projects they&#8217;ve even chained inheritance three or four levels deep to apply different styles by course, category or site. <strong>The takeaway:<\/strong> a child theme is also a reversible patch layer, as long as you document what it fixes and remove it once the parent solves the issue.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Common_mistakes_when_creating_a_Moodle_child_theme\"><\/span>Common mistakes when creating a Moodle child theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Folder and name that don&#8217;t match:<\/strong> if the folder, <code>$THEME-&gt;name<\/code> and the component in <code>version.php<\/code> aren&#8217;t identical, Moodle doesn&#8217;t detect the theme or throws an error on install.<\/li>\n\n\n<li><strong>Wrongly named language files:<\/strong> they must be called <code>theme_[name].php<\/code> in every language folder.<\/li>\n\n\n<li><strong>Overridden template without the component folder:<\/strong> Moodle keeps using the parent&#8217;s and the change seems not to work.<\/li>\n\n\n<li><strong>Editing the parent theme &#8220;just to test&#8221;:<\/strong> the change will be lost in the next update. Always test in the child.<\/li>\n\n\n<li><strong>Not purging caches:<\/strong> style changes don&#8217;t appear until you clear the cache or turn on theme designer mode.<\/li>\n\n\n<li><strong>Expecting the child to inherit the parent&#8217;s settings:<\/strong> colors or images configured in Boost don&#8217;t carry over to the child without configuration inheritance.<\/li>\n\n\n<li><strong>Copying the Boost recipe for a Classic child:<\/strong> Classic needs its own steps and must inherit from both Boost and Classic.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_customize_your_Moodle_without_starting_from_scratch\"><\/span>How to customize your Moodle without starting from scratch<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A child theme is the foundation of any serious Moodle customization, but designing and maintaining it takes development time. If you&#8217;d rather have a ready-to-use solution, the <a href=\"https:\/\/tresipunt.com\/en\/suite-fresk-moodle\/\"><strong>Fresk Suite for Moodle and Workplace<\/strong><\/a> offers an adaptable visual design without coding. If your project needs a custom theme, the <a href=\"https:\/\/tresipunt.com\/en\/custom-development\/\"><strong>3ipunt custom development<\/strong><\/a> team designs and maintains it; we also offer <a href=\"https:\/\/tresipunt.com\/en\/moodle-support\/\"><strong>technical support for Moodle<\/strong><\/a>. <strong><a href=\"https:\/\/tresipunt.com\/en\/contact-us\/\">Tell us what you need<\/a>.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_asked_questions_about_Moodle_child_themes\"><\/span>Frequently asked questions about Moodle child themes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Whats_the_difference_between_a_theme_and_a_child_theme_in_Moodle\"><\/span>What&#8217;s the difference between a theme and a child theme in Moodle?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A full theme defines its own styles, templates, layouts and renderers. A child theme contains only the changes and inherits the rest from a parent theme declared in <code>config.php<\/code>. That&#8217;s why it&#8217;s quicker to create and easier to maintain when updating.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Which_theme_should_the_child_theme_be_based_on\"><\/span>Which theme should the child theme be based on?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Boost is the most common choice because it&#8217;s Moodle&#8217;s default theme, it&#8217;s updated with every release and it&#8217;s well documented. You can also inherit from a third-party Boost-based theme if it&#8217;s actively maintained; the more stable the parent, the less work you&#8217;ll have with each update.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Do_I_lose_my_child_theme_when_I_update_Moodle\"><\/span>Do I lose my child theme when I update Moodle?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No, the child theme is an independent plugin and it&#8217;s kept. What can happen is that a template, layout or renderer you&#8217;ve overridden no longer matches the parent&#8217;s new version. That&#8217;s why it&#8217;s worth reviewing overridden files and testing in a staging environment before updating production.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Do_I_need_to_know_how_to_code_to_create_a_child_theme\"><\/span>Do I need to know how to code to create a child theme?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For a child theme with custom styles, knowing CSS and following the file structure is enough. To override templates you need HTML and Mustache; for layouts and renderers, PHP and knowledge of Moodle&#8217;s architecture. If you don&#8217;t have that profile, there are visual no-code alternatives.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_I_create_a_child_theme_of_another_child_theme\"><\/span>Can I create a child theme of another child theme?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, Moodle lets you chain inheritance, for example Boost, an intermediate theme and your theme. You need to declare the direct parent in <code>config.php<\/code> and its version in the dependencies. Each level adds a theme to review when updating, so it&#8217;s best not to lengthen the chain unnecessarily.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_I_temporarily_hide_a_child_theme_that_has_errors\"><\/span>How do I temporarily hide a child theme that has errors?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Set <code>$THEME-&gt;hidefromselector = true;<\/code> in its <code>config.php<\/code> and purge the caches. The theme no longer appears in the site, category and course selectors, so nobody can activate it while you fix it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this workshop we will learn what a child theme is and its importance in the development and customization, especially graphics, of any Moodle. It will be explained what kind of customizations can be made with a child theme and some basic inheritance issues regarding the parent theme.<\/p>\n","protected":false},"author":1,"featured_media":15590,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[136,138],"tags":[],"class_list":["post-13227","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-moodle","category-events"],"acf":[],"author_meta":{"display_name":"admin_tresipunt","author_link":"https:\/\/tresipunt.com\/en\/author\/admin_tresipunt\/"},"featured_img":"https:\/\/tresipunt.com\/wp-content\/uploads\/2020\/01\/crea_childtheme_5-300x169.png","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/tresipunt.com\/en\/blog\/moodle\/\" class=\"advgb-post-tax-term\">Moodle<\/a>","<a href=\"https:\/\/tresipunt.com\/en\/blog\/events\/\" class=\"advgb-post-tax-term\">Events<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">Moodle<\/span>","<span class=\"advgb-post-tax-term\">Events<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 7 years ago","modified":"Updated 13 hours ago"},"absolute_dates":{"created":"Posted on 16\/01\/2020","modified":"Updated on 03\/12\/2026"},"absolute_dates_time":{"created":"Posted on 16\/01\/2020 0:00","modified":"Updated on 03\/12\/2026 14:14"},"featured_img_caption":"","series_order":"","_links":{"self":[{"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/posts\/13227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/comments?post=13227"}],"version-history":[{"count":4,"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/posts\/13227\/revisions"}],"predecessor-version":[{"id":57089,"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/posts\/13227\/revisions\/57089"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/media\/15590"}],"wp:attachment":[{"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/media?parent=13227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/categories?post=13227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tresipunt.com\/en\/wp-json\/wp\/v2\/tags?post=13227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}