Moove

1. Config.php

Changes in /theme/moove/config.php :-

Update $THEME->layout 

In layouts array there are lots of layout available we will update two layouts frontpage and mydashboard

We will update the regions array and add new layout names with existing ones (‘full-width-top’, and ‘full-bottom’) 

At line no 68

Code:

// The site home page.

    ‘frontpage’ => [

        ‘file’ => ‘frontpage.php’,

        ‘regions’ => [‘side-pre’, ‘full-width-top’, ‘full-bottom’],

        ‘defaultregion’ => ‘side-pre’,

        ‘options’ => [‘nonavbar’ => true],

    ],

At line no 88

Code:

// My dashboard page.

    ‘mydashboard’ => [

        ‘file’ => ‘drawers.php’,

        ‘regions’ => [‘side-pre’, ‘full-width-top’, ‘full-bottom’],

        ‘defaultregion’ => ‘side-pre’,

        ‘options’ => [‘nonavbar’ => true, ‘langmenu’ => true],

    ],

See the below screenshot

AD 4nXcY gf4C lV3SY0AhfgyEKps2wHsww2FQK2N8EJQXlSi VZrFOldecbdRxCS0h1YKxiF7I PzfdT5nLnwG78dEzfZhoylrIkL1q4iq99JhIsMFaZoIt15 lBrTdIym yIqbwcQw?key=TPh6w bpl2ZimwvlNQvMLg

2. Changing the relevant php file

Php file name is mentioned on config layout with file field (see the $THEME->layout layouts)

For frontpage frontpage.php

for mydashboard drawers.php is mention

-> these files are located on layout folder of theme and if not present directly copy it by boost layout and paste it to moove theme layout folder to make some changes

frontpage.php and drawers.php is already present on moove theme

Changes in /theme/moove/layout/drawers.php :-
Add following code at line no 124 after this line                                            $templatecontext = array_merge($templatecontext, $themesettings->footer());

Code:
            // Top region full width.

if (in_array(“full-width-top”, $this->page->blocks->get_regions())) {

    $addblockbuttonfwtop = $OUTPUT->addblockbutton(‘full-width-top’);

    $sidefwtopblocks = $OUTPUT->blocks(‘full-width-top’);

    // Strlen Calculation is total jugad.

    if (trim($addblockbuttonfwtop) != ” || (trim($sidefwtopblocks) != ” && strlen($sidefwtopblocks) > 117)) {

        $templatecontext[‘addblockbuttonfwtop’] = $addblockbuttonfwtop;

        $templatecontext[‘sidefwtopblocks’] = $sidefwtopblocks;

        $templatecontext[‘canaddfwtopblocks’] = true;

    }

}

// bottom region full width.

if (in_array(“full-bottom”, $this->page->blocks->get_regions())) {

    $addblockbuttonfwbottom = $OUTPUT->addblockbutton(‘full-bottom’);

    $sidefwbottomblocks = $OUTPUT->blocks(‘full-bottom’);

    // Strlen Calculation is total jugad.

    if (trim($addblockbuttonfwbottom) != ” || (trim($sidefwbottomblocks) != ” && strlen($sidefwbottomblocks) > 117)) {

        $templatecontext[‘addblockbuttonfullwidthbottom’] = $addblockbuttonfwbottom;

        $templatecontext[‘sidefullwidthbottomblocks’] = $sidefwbottomblocks;

        $templatecontext[‘canaddfullwidthbottomblocks’] = true;

    }

}

See the below screenshot

Changes in /theme/moove/layout/frontpage.php :-
Add following code at line no 118 after this line                                             $templatecontext = array_merge($templatecontext, $themesettings->footer());

Code:
            // Top region full width.

if (in_array(“full-width-top”, $this->page->blocks->get_regions())) {

    $addblockbuttonfwtop = $OUTPUT->addblockbutton(‘full-width-top’);

    $sidefwtopblocks = $OUTPUT->blocks(‘full-width-top’);

    // Strlen Calculation is total jugad.

    if (trim($addblockbuttonfwtop) != ” || (trim($sidefwtopblocks) != ” && strlen($sidefwtopblocks) > 117)) {

        $templatecontext[‘addblockbuttonfwtop’] = $addblockbuttonfwtop;

        $templatecontext[‘sidefwtopblocks’] = $sidefwtopblocks;

        $templatecontext[‘canaddfwtopblocks’] = true;

    }

}

// bottom region full width.

if (in_array(“full-bottom”, $this->page->blocks->get_regions())) {

    $addblockbuttonfwbottom = $OUTPUT->addblockbutton(‘full-bottom’);

    $sidefwbottomblocks = $OUTPUT->blocks(‘full-bottom’);

    // Strlen Calculation is total jugad.

    if (trim($addblockbuttonfwbottom) != ” || (trim($sidefwbottomblocks) != ” && strlen($sidefwbottomblocks) > 117)) {

        $templatecontext[‘addblockbuttonfullwidthbottom’] = $addblockbuttonfwbottom;

        $templatecontext[‘sidefullwidthbottomblocks’] = $sidefwbottomblocks;

        $templatecontext[‘canaddfullwidthbottomblocks’] = true;

    }

}

See the below screenshot

AD 4nXc8MiLuoepUza96Wz7CEmfIVwZYjeq9LfW4IfOOM3dkirVFhFnJqTOEg5f2yIm0VG iPwlTcMUQEIqf1QOWFJQlPqwDri8bftPpzcEopWC1tjqusgnzMlO MXFMgJMPZYcq39O4DA?key=TPh6w bpl2ZimwvlNQvMLg

3. Now we can add regions anywhere on frontpage, and dashboard by mustache file 

1. For dashboard

    You can add regions anywhere on the Frontpage or Dashboard via the related Mustache file.

    The Mustache file path is mentioned in the last line of the related PHP file.

    Example:

    On the Dashboard, you will see this line at the end of the PHP file:

    echo $OUTPUT->render_from_template(‘theme_moove/drawers, $templatecontext);

    This means the Mustache path is:
    drawers

    It is located at:
    theme/moove/templates/drawers.mustache

    Note:

    We had to add two regions 1st on top and 2nd on bottom

    Changes in /theme/moove/templates/drawers.mustache :-

    At line no 99 add following code after the line <div id=“page” data-region=“mainpage”…..

    Code:

    {{#canaddfwtopblocks}}

            <section id=”region-fullwidthtop-blocks” class=”has-blocks” aria-label=”region top blocks”>

                <div role=”region-main”>

                    {{{ sidefwtopblocks }}}

                    {{#addblockbuttonfwtop}}

                       <div id=”region-fullwidthtop-blocks-indicator” class=”container-fluid block-indicator”>

                            <font class=”text-center p-px-2d5 m-0  bg-white block-indicator-text-wrapper “>

                                Full-width Top

                            </font>

                        </div>

                    {{/addblockbuttonfwtop}}

                </div>

            </section>

    {{/canaddfwtopblocks}}

     See the below screenshot

    AD 4nXcQ62AHPPgxZsG85eEPNmeOceuDhc6h9DlLvp87oQXITGRmsr55OqLLvq7Ds6XaNvw0C9b4RaGeM17cSqtqgLfpU7IXOkSjftbNfdsRvAJrRCuKprn

    At line no 184 add following code before the line {{> theme_moove/footer }}

    Code:
    {{#canaddfullwidthbottomblocks}}

      <section id=”region-fullwidthbottom-blocks” class=”has-blocks” aria-label=”region top blocks”>

           <div role=”region-main”>

                 {{{ sidefullwidthbottomblocks }}}

                 {{#addblockbuttonfullwidthbottom}}

                 <div id=”region-fullwidthbottom-blocks-indicator” class=”container-fluid block-indicator”>

                      <font class=”text-center p-px-2d5 m-0  bg-white block-indicator-text-wrapper “>

                       Full-width Bottom

                      </font>

                 </div>

                 {{/addblockbuttonfullwidthbottom}}

            </div>

      </section>

    {{/canaddfullwidthbottomblocks}}

    See the below screenshot

    AD 4nXcndnB1RF3ldVSpAsXJuczdECULv4aphNO6bVOqzf6nS1VkJufrEdBkMoYPnArOHgg1YJQ9XH 62sGpAvQEOBQCbbSU JbK93IbYsvR8EZ2TBDO9MOtFufHicijEgkAd8m7Hlbf?key=TPh6w bpl2ZimwvlNQvMLg

    2. For frontpage layout

    The same applies to the Frontpage layout.

    The Mustache path used is:

    frontpage

    Changes in /theme/moove/templates/frontpage.mustache :-

    At line no 63 add following code after the line <div id=“page” data-region=“mainpage”…..

    Code:

    {{#canaddfwtopblocks}}

            <section id=”region-fullwidthtop-blocks” class=”has-blocks” aria-label=”region top blocks”>

                <div role=”region-main”>

                    {{{ sidefwtopblocks }}}

                    {{#addblockbuttonfwtop}}

                       <div id=”region-fullwidthtop-blocks-indicator” class=”container-fluid block-indicator”>

                            <font class=”text-center p-px-2d5 m-0  bg-white block-indicator-text-wrapper “>

                                Full-width Top

                            </font>

                        </div>

                    {{/addblockbuttonfwtop}}

                </div>

            </section>

    {{/canaddfwtopblocks}}

     See the below screenshot

    AD 4nXcdQnFReVzEpOQ804RVbJMlvtFICE1XZpJvnNvYE9yj4sqa7QsEck7OpeKWKvPhiXyAcTwQ5cqOjK4rtd1Aw ZDSklqmDOqjuOZ2AH2QEIyaddZznGjfqgNM Zz2U2wDW8NCsrQ?key=TPh6w bpl2ZimwvlNQvMLg

    At line no 227 add following code before the line {{> theme_moove/footer }}

    Code:
    {{#canaddfullwidthbottomblocks}}

      <section id=”region-fullwidthbottom-blocks” class=”has-blocks” aria-label=”region top blocks”>

           <div role=”region-main”>

                 {{{ sidefullwidthbottomblocks }}}

                 {{#addblockbuttonfullwidthbottom}}

                 <div id=”region-fullwidthbottom-blocks-indicator” class=”container-fluid block-indicator”>

                      <font class=”text-center p-px-2d5 m-0  bg-white block-indicator-text-wrapper “>

                       Full-width Bottom

                      </font>

                 </div>

                 {{/addblockbuttonfullwidthbottom}}

            </div>

      </section>

    {{/canaddfullwidthbottomblocks}}

    See the below screenshot

    AD 4nXcbphsuXetRLeeWjl6z2qR3eyBh7ZaqHB6Pyh10ZHia 5MZRodD1 EnPTM5xJQH2GGJAKS O2wPBzgntqfa6K2f3oLkhUdp3cRVTkNiBkul8im7hRr890MKjeOUDjhDGe jVOl5vA?key=TPh6w bpl2ZimwvlNQvMLg

    Now Enable the edit mode and go to the homepage, dashboard, or any custom page; you will now be able to add page builder blocks as well as Moodle blocks.

    Was this page helpful?