I am pretty happy with the flexibility of PHPTemplate. However, I would like to have two seperate style sheets. One would load for the majority of the site and be fixed width and in the center. Whenever you enter the admin section you would get a more flexible full window width style sheet. Does anyone have any suggestions on how to accomplish this in PHPTemplate?
My ideal situation would be a PHP snippet that would look at the current page URI and check for the '/admin/' string. Based on that check it would print the default style sheet call or the admin style sheet call.
I just can't find any information on how PHPTemplate calls styles other than that it only looks for a single file called, style.css. In my page.tpl.php file all I have is :
<?php print $styles ?>.
Comments
Hmm....this works, but is it right?
So I guess I sorta answered my own question. Here is what I came up with:
I replaced
<?php print $styles ?>with
see code at : http://ltc.smm.org/geeks_drupal/code.txt
I had to provide a link to the code since it won't post in the forum b/c of the PHP.
That works for me but I don't know if there is an easier way to do this for a non-php user who might want this functionality. Any ideas are appreciated.
AT CivicSpace http://www.civi
AT CivicSpace http://www.civicspacelabs.org the front page is fixed width but some pages, e.g. download, are fluid. I have no idea how they did it though.
Chris
what you could do ..
is use the following in your conf.php
Ideally you would use the args() function, but i am not sure if it is already defined at that point.
The print $styles is to print the style tags. by setting your theme to mytheme/style, it will automatically use themes/mytheme/admin/style.css instead of themes/mytheme/style.css
this works for all kinds f themes, and not just phptemplate.
--
The future is so Bryght, I have to wear shades.
what does globals custom_theme do?
I get this script right up to the
part.
Do I need to call the custom_theme var somewhere in my template? I made a folder inside my theme directory called admin and placed the new style.css file in there. But the page doesn't call it. Forgive my ignorance; I did some searching and couldn't find any reference to this information.
No need to put it in your theme
Basically, duplicate your entire theme directory and replace the CSS file.
There may be a better way to do it with stylesheets only, but this definitely works. As well, you can have completely different layouts.
Now, if we make this accessible via a regex system similar to the block selection screen, it would make it very easy to select different themes for different sections.
drupal checks for this
it uses the default specified theme, only if a custom theme hasnt been specified.
a theme can be either 'themename' (like chameleon) , or 'themename/stylename' (like marvin).
Stylesheet switching is inherent in the theme system design.
--
The future is so Bryght, I have to wear shades.
Dynamically selectable theme
http://www.autowitch.org/?q=node/view/1255
that is a bit out of date.
drupal supports the feature natively now
http://webschuur.drupaldevs.org
Also, i really like the theme for your site, it impresses me more everytime i go there. =)
(i wrote phptemplate btw).
--
The future is so Bryght, I have to wear shades.
thanks for all the help
hey folks,
thanks for all the help. i really like phptemplate. once we get some really definitive documentation out there and a final version on the projects page it is gonna kick a**. when i get a chance i will write a version of this discussion into the handbook section on phptemplate.
just for clarity, am I right in assuming that to switch themes in the more native drupal way I would link to a page like this
<a href="/node/123?theme=mythemename">Switch to the My Theme, Theme</a>