Can Theme override Front Page(s)? 2.5 Bootstrap

Can Theme override Front Page(s)? 2.5 Bootstrap

by Brian Merritt -
Number of replies: 1
Picture of Particularly helpful Moodlers

I would like to generate a renderer or option in Theme that detects the front page, and which loads one of several front pages depending upon whether the user is logged in.

 

Is there a way for the theme to override or alter "main_content" ?  I presume (maybe incorrectly) that if I go

    $OUTPUT->main_content = $outputhtmlcontent ;

that things will go south.

I tried this method

$CFG->customfrontpageinclude=($CFG->dirroot.'\theme\iscacoach\layout\iscafrontpage.php');

 

Which works OK, but the moment I invoke any echo $OUTPUT->   then I get a "main_content" missing exception error.

Is the current method us $CFG->customfrontpageinclude still or are there better methods?

 

Thanks!

 

Brian

 

Average of ratings: -
In reply to Brian Merritt

Re: Can Theme override Front Page(s)? 2.5 Bootstrap

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

Take a look at the comments in MDL-30132 which I have recently fixed.

The discussion towards the end of the page is interesting and deals with adding extra content the way you are wanting to do.

Cheers

Mary