A few question about costum theme

A few question about costum theme

Maria B. -
回帖数:4
Hello to everyone,

I am finishing my own theme and have some questions like:

1. Is there any code that I can put in style or some other php file which will detect IE6 and older browsers in order to display standard theme for them rather than my costume theme? The users with new generation of browsers will see my costum theme, of course.
I am tired of hacking my css for those users with old browsers since my course is set to CSS/tables free.
2. I would like to make three or four color schemes for single theme (like blue, green, etc) and put switch buttons in the header. Something like this:
http://www.le-herisson-a-lunettes.com/
Is this possible anyway and how?

Thank you!
回复Maria B.

Re: A few question about costum theme

Patrick Malley -
1.) If you look in the Standard theme folder you will find two files for specifying ie6 and ie7 hacks. You can add such files to your custom theme by copying them and meta.php (also in the Standard theme folder) from the Standard theme and changing to suite your needs.

If you use meta.php, you will have to change the code to reflect your new absolute path to styles_ie6.css and styles_ie7.css in your custom theme folder.

To turn on meta.php in a custom theme, you will have to edit config.php.

In particular, you will want to set

$THEME->metainclude = false;

to true.

2.) I have created a style switcher that I have meant to write more on, but have become busy with my classes. You can find the source of the javascript switcher that I used here. When I get the time, I plan to write more Moodle specific instructions on making this happen.

So, yes. Both are possible!
回复Maria B.

Re: A few question about costum theme

Maria B. -
Just one more question.

I would like to have two different footers - one for course home page and the other for nocourse pages.

Something like this:

<?php if ($course) { // This is what gets printed on course home page only
?>
<div id="footer1">Footer 1</div>
<?php } else { // This is what gets printed on any other page with a footer
?>
<div id="footer2">Footer 2</div>
<?php } ?>

but I am not sure which string I should use in order to get this.

$course is wrong since I get Footer 1 on nocourse pages as well.

Is this possible because in header.html I saw this:

<?php if ($home) { // This is what gets printed on the home page only
?>
<div id="header-home">Header Home / Front Page</div>
<?php } else { // This is what gets printed on any other page with a heading
?>
<div id="header"> Other pages </div>
<?php } ?>


I can not do what I want using css I have to print two different footers in footer.html.