I have created a theme by copying the boxxie theme folder in the moodle/theme folder and renaming it to my theme. Now I wanted to have my own BEFORE LOGIN front page so in the theme/mytheme/config.php i changed the file for 'frontpage' of the $THEME->layouts from 'frontpage.php' to 'index.php' where index.php is the index page of my custom html theme.
I have put the folders(css, js etc) in the layout folder of the theme and after the selecting the theme from the moodle admin section, its working fine.
Now, the problem is that I am using the same theme for about.php and a few other php pages. Now whenever i open the about.php page from the browser, it displays an error that the $OUTPUT variable is not recognizable as I am using $OUTPUT->login_info() method in all the pages to get the login info of either logged in or not logged in.
Following is the code which is working fine in the theme/mytheme/layout/index.php (as it is being included in the main index.php file) but showing an error in the theme/mytheme/layout/about.php
<span style="font-size: 15px; color: #ffffff;"><?php echo $OUTPUT->login_info(); ?></span>
What have i tried ?
Storing the output in a session variable ($_SESSION['myoutputvar']).
Making a global variable and storing the $OUTPUT in that variable.
But none of this worked. I know the problem but can't find a solution and after hours of searching, I am finally posting it here.
So, I would be glad to receive any kind of help from you guys. Thanks in advance.