Hi,

I have about five different .css files of different colors. I would like to setup 'secondary links' to link to each of different style sheets.

Does anyone know how to do this?

I have searched through these forums, and also tried to look at code, but none of it made sense.

Thanks for your help!

Added Bonus: If you can also change the font size, like here you would be da man!

Regards, th3gh05t

Comments

Steve Dondley’s picture

One way you might accomplish this is to set up 5 different drupal sites, each in their own directory. <ignore>Then set them up to share the same database with the exception of the "variable" table, which contains the information to tell drupal what the default theme is. Alternatively, you could hack the 'includes/theme.inc' file in each of the 5 sites to force it to load a particular theme instead of getting the theme info from the database. You can find where to do this in the code by searching for 'variable_get('theme_default') in the theme.inc module.</ignore>

Then, just have each of the secondary links on each of the 5 sites point to the appropriate drupal directory.

I can't think of a better way. Hopefully someone else can. Good luck!

OOPS, WAIT: If you are making the changes to the same theme in each of the drupal sites, then you don't have to worry about isolating the "variable" database table or hacking theme.inc. So never mind that stuff.

adrian’s picture

IE: for each of them have a subdirectory under bluemarine

so you have the default style :
themes/bluemarine/style.css

and then :

themes/bluemarine/red/style.css
themes/bluemarine/green/style.css
themes/bluemarine/orange/style.css

Then, in your conf.php file , you have a section that goes :


if ($_GET['theme']) {
 $_SESSION['session_theme'] = $_GET['theme'];
}

if ($_SESSION['session_theme']) {
  $GLOBALS['custom_theme'] = $_SESSION['session_theme'];
}

Then you just link to ?theme=bluemarine , ?theme=bluemarine/red .. etc

The drupal theme garden uses this method (http://webschuur.drupaldevs.org)

--
The future is so Bryght, I have to wear shades.

th3gh05t’s picture

Hi,

Thanks for your reply!

I think that I will use your method. ;)

I will tell you how it works. :P

Regards, th3gh05t

th3gh05t’s picture

I put the php code in my conf.php. But the system doesn't seem to be working.

I added what you had to the bottom of the file, is that okay?

I have the links down, and I have put the files and directories like you suggested.

So I am assuming that it is my conf.php which is messing things up.

Edit: When I moved that code to the top of the file, got some header errors.

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/derek/www/drupal/includes/conf.php:9) in /home/derek/www/drupal/includes/session.inc on line 10

warning: Cannot modify header information - headers already sent by (output started at /home/derek/www/drupal/includes/conf.php:9) in /home/derek/www/drupal/includes/common.inc on line 160.

Again, thanks very much for your time!

Regards, th3gh05t

Bèr Kessels’s picture

It looks like your sever is not properly configured to allow sessions and cookies.

And if this solved you problem, would you be so kind to report back that it helped? This will help others whom are looking for the same solution.

[Ber | Drupal Services webschuur.com]

th3gh05t’s picture

Actually, I just out that php code in my session.inc file, and everything worked.