Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Upgrading themes to Moodle 3.6: Difference between revisions

From MoodleDocs
(Created page with "{{Moodle 3.2}} {{Template:Themes}} Moodle 3.6 adds a few new features that effects child themes, the new messaging user interface requires a renderer callback to load the mes...")
 
m (Text replacement - "</code>" to "</syntaxhighlight>")
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
If your child theme overrides one of these Boost layout files:
If your child theme overrides one of these Boost layout files:


<code php>
<syntaxhighlight lang="php">
templates/columns1.mustache
templates/columns1.mustache
templates/columns2.mustache
templates/columns2.mustache
</code>
</syntaxhighlight>


You will need to add this callback to your custom layout file:  
You will need to add this callback to your custom layout file:  


<code php>
<syntaxhighlight lang="php">
{{{ output.standard_after_main_region_html }}}
{{{ output.standard_after_main_region_html }}}
</code>
</syntaxhighlight>


You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:
You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:


<code php>
<syntaxhighlight lang="php">
<div id="page" class="container-fluid">
<div id="page" class="container-fluid">
...
...
</div>
</div>
{{{ output.standard_after_main_region_html }}}
{{{ output.standard_after_main_region_html }}}
</code>
</syntaxhighlight>
If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for login, maintenance or the secure.mustache layout.
If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for login, maintenance or the secure.mustache layout.


Line 33: Line 33:
If your child theme overrides one of these layout files:
If your child theme overrides one of these layout files:


<code php>
<syntaxhighlight lang="php">
layout/columns1.php
layout/columns1.php
layout/columns2.php
layout/columns2.php
layout/columns3.php
layout/columns3.php
</code>
</syntaxhighlight>


You will need to add this callback to your custom layout file:
You will need to add this callback to your custom layout file:


<code php>
<syntaxhighlight lang="php">
<?php echo $OUTPUT->standard_after_main_region_html() ?>
<?php echo $OUTPUT->standard_after_main_region_html() ?>
</code>
</syntaxhighlight>


You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:
You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:


<code php>
<syntaxhighlight lang="php">
<div id="page-content" class="row-fluid">
<div id="page-content" class="row-fluid">
...
...
</div>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>
<?php echo $OUTPUT->standard_after_main_region_html() ?>
</code>
</syntaxhighlight>


If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for embedded, maintenance, popup or the secure.php layout.
If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for embedded, maintenance, popup or the secure.php layout.

Latest revision as of 20:11, 14 July 2021

Moodle 3.2


Moodle 3.6 adds a few new features that effects child themes, the new messaging user interface requires a renderer callback to load the message drawer. This can affect boost and bootstrap base child themes.

Boost based child themes

If your child theme overrides one of these Boost layout files:

templates/columns1.mustache
templates/columns2.mustache

You will need to add this callback to your custom layout file:

{{{ output.standard_after_main_region_html }}}

You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:

<div id="page" class="container-fluid">
...
</div>
{{{ output.standard_after_main_region_html }}}

If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for login, maintenance or the secure.mustache layout.

Bootstrapbase based child themes

If your child theme overrides one of these layout files:

layout/columns1.php
layout/columns2.php
layout/columns3.php

You will need to add this callback to your custom layout file:

<?php echo $OUTPUT->standard_after_main_region_html() ?>

You custom layout file might define its own main content region, adding the renderer callback after this region should make it work:

<div id="page-content" class="row-fluid">
...
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>

If your theme defines its own layout files, make sure the callback is added there too. The callback should not be added to layout files for embedded, maintenance, popup or the secure.php layout.