Problem cloning more theme

Problem cloning more theme

by Naaman Fallouh -
Number of replies: 4

Hi,

I'm trying to clone the modify the `more` theme in moodle 2.9.1, the cloning is working well (copy and replace) but my problem is when trying to create my own front-page. I did the following:

  • create directory (..\theme\morext\layout)
  • get the (columns3.php) from the `bootstrapbase` theme and rename it to 'frontpage.php'
  • add layout configurations in (config.php) like this:
  • $THEME->layouts = array(
        // The site home page.
        'frontpage' => array(
            'file' => 'frontpage.php',
            'regions' => array('side-pre', 'side-post'),
            'defaultregion' => 'side-pre',
            'options' => array('nonavbar' => false),
        ),
    );
  • in the setting, the `invert navbar` is on
The problem is at the navigation bar, in all pages it's okay except the front-page that uses my new layout, the `navbar` looks not inverted as if the setting option isn't activated on it.

The attachment snapshot shows `navbar` in black for every page where it's while in the front page.

Am I missing anything here?

Attachment Capture.jpg
Average of ratings: -
In reply to Naaman Fallouh

Re: Problem cloning more theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

More actually inherits its layouts from Clean as that is the first parent with the layout files and if you look at the classes for the <header> they are a little different

bootstrapbase

<header role="banner" class="navbar navbar-fixed-top moodle-has-zindex">

clean

<header role="banner" class="navbar navbar-fixed-top<?php echo $html->navbarclass ?> moodle-has-zindex">

It's that <?php echo $html->navbarclass ?> bit which I believe picks up the setting, so you need to add that in to your cloned layout file.

Average of ratings: Useful (1)
In reply to Naaman Fallouh

Re: Problem cloning more theme

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

If you follow Richard's suggestion you will be on the right track, however it would be better if you deleted your original 'frontpage.php' that you made and just copy clean/layout/column3.php and rename that as your 'frontpage.php' as there are other bits of code which your theme will need, that the Bootstrapbase layout files do not contain.

Cheers

Mary

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Problem cloning more theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Good point - I'd only looked at the one specific issue, but as Mary quite rightly points out there are other differences between the layout files in bootstrapbase and the ones more actually uses from Clean smile