Theming: New format- Flexible Page

Theming: New format- Flexible Page

by Matt Albert -
Number of replies: 10
It is possible to use flexpage with other themes but there has to be some code changes to the header.html in your custom theme. Specifically drop the following in your header.html of your custom theme (this is in place of the code in the header.html file):
<?php
/**
* Theme Header
*
* @author Mark Nielsen
* @version $Id$
* @package theme_cisco
**/

include($CFG->themedir.'/'.$THEME->parent.'/header.html');

?>

Once you have done this you can modify the tabs with a little CSS fun to get them to fit your needs. I attached a screen capture of the custom theme and tabs that I created. Good Luck!
Attachment Picture-1.png
Average of ratings: -
In reply to Matt Albert

Re: New format- Flexible Page

by jimmy kent -
Thanks a lot mate, that was really helpful

In reply to jimmy kent

תשובה ל: Re: New format- Flexible Page

by Irith Herman -
where did you change the colors and the shape of the menu banner
i dont like the round corners

irith
Attachment 1.png
In reply to Matt Albert

Re: New format- Flexible Page

by joe cool -
I tried replacing the code above in header.html of the wood theme, but something more seems to be needed. I notice in flex_mrooms theme, the same code is also in footer.html as in header.html, which is identical to the code above.

What other files need to change, if any?

I could poke around in the files, but if anyone has the answer, I'd appreciate it!

Thanks!
In reply to joe cool

Re: New format- Flexible Page

by joe cool -
I found the answer - at least the main part ... and since it might help others, here it is:

This line for the header.html file is supposed to include the header.html from the page theme:

include($CFG->themedir.'/'.$THEME->parent.'/header.html');

I had Moodle print out the actual file above,

print $CFG->themedir.'/'.$THEME->parent.'/header.html';

and it turned out to NOT be the page theme's header.html. It was the parent of MY theme, which of course was not the page theme. The page theme IS the parent of flex_mrooms, though.

By simply replacing the above line with the absolute path to the page theme's header.html, the page tabs, etc. showed up in my modified theme!

It's a kluge, but it works.

I still have some tweaking to do... the page menus, when displayed as tabs, are always expanded regardless of which page I am on. But they seem to work OK if they are not displayed as tabs.
In reply to joe cool

Re: New format- Flexible Page

by Brian Morris -
Can you give me an example of how to make an absolute path to the page theme? Thanks in advance.
In reply to Brian Morris

Re: New format- Flexible Page

by joe cool -
How to do this depends on the operating system of your server. On Linux, an absolute path starts with a slash /.

An example might be (this will be different for you course - this is an example)

/home/your_account_name/public_html/moodle/theme/standard

for the standard theme, in the theme folder.

So, the computer would look for the standard directory (folder) in the theme directory, and start looking in /, which is the top level directory. In / it would look for the next directory in the list, or path, above, and continue with each folder (directory) listed.

Without the /, you have a relative path. Instead of starting at the top directory, the computer looks in the current directory for the first directory in the list or path.

This is pretty much the same in Windows, except the top level is C:\ or some other letter.

Of course, this means knowing precisely where the directories and files are located. If you are not sure, the system administrator should be able to tell you.
In reply to joe cool

Re: New format- Flexible Page

by joe cool -
The absolute path above, along with the file name (header.html), would then need to be included in quotes, and in an include statement, as below:

include('/home/your_account_name/public_html/moodle/theme/page/header.html');

in order to include the header.html file. I did not include the file name - the above post was a more generic example of an absolute path.

Single or double quotes may be used - but the opening and closing quote marks should match (both be single quote marks, or both be double quote marks).
In reply to joe cool

Re: New format- Flexible Page

by Claire Browne -
Where do I find the flex moodle rooms .css files to download?
In reply to Claire Browne

Re: New format- Flexible Page

by joe cool -
It's been a while since I installed the flex page course format, but I think there was a separate theme that works with it, to be also downloaded and installed. If you have that theme, then you probably have the css files.

Other than that, I don't know.