I had an issue getting this module working because my base theme (zen) was not enabled.
I couldn't figure it out because my sub-theme was able to pull style sheets from from base (zen), however none of the conditional stylesheet settings I had in my sub-theme's *.info file took affect.
Just a thought, would it be possible to add this to the README.txt file:
The base theme MUST be enabled in-order for the module to work with any sub-themes
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | conditional_styles.0.patch | 5.77 KB | ericxb |
Comments
Comment #1
ericxb commentedBeyond that, the theme itself must be enabled. This may seem obvious; but it is the case that one can simple select a "default" theme with the radio button and not actually check off "enabled." The theme will work, but the conditional-stylesheets will not.
In styles.theme.inc lines 44-46:
Attached here is a patch which expands on the list of active themes by explicitly adding the current theme, the administration theme and any possible base themes that any have. The patch is deceptively large. All the real changes are at the top, the rest is just a change of indent level.
Comment #2
jlbretton commentedThanks for your patch.
Some more feedback: Without your patch, if you're enabling the theme back, it won't work again. The solution beeing to manually delete the conditional_stylesheets variable (like with Devel or directly on your db) and then only, check off the base template. In this case the module will read and write back in the db the variable, wich will make correctly work the module. For some reason, If you deasable the base theme again, you will have to redo all those manipulations.
Jean
Comment #3
jensimmons commentedOH, really, you have to have the base theme enabled? Well, I can't use this module then. I'm making heavy use of skinr, and when more than one theme is enabled, the list of available skins is duplicated for each theme. I've been training everyone to enable only one theme.
It's also dangerous that if someone un-enabled a theme, all of the ie bug fixes are gone. Too easy for things to get seriously broken in a large enterprise environment where communication is a challenge.
Sad. I'm going back to handcoding them into the theme. :(
Comment #4
senortim commentedI'm having a problem with Zen 1.11 (not using this module) in which I don't get any of the conditional codes in my rendered HTML, despite having them in my .info file.
John? Anyone? Could this be because I haven't properly sub-themed from Zen? Being a Drupal newbie, I was confused by the sub-theming and just copied everything into my own "base" theme.
Thanks,
Tim
Comment #5
johnalbin@ChrisRut: No, you don't need the base theme Zen enabled for this module to work. I never enable the Zen theme on any of the sites I build.
I suspect what happened was that you did not clear Drupal's .info file cache after you made changes to your sub-theme's .info file. The README.txt states:
But since things weren't working, you went to admin/build/themes to enable Zen and thought that the action of enabling Zen fixed the problem. In fact, it was just visiting the admin/build/themes page that fixed your problem.
@senoritim: If you visit admin/build/themes, Drupal will pick up the changes to your sub-theme's .info file.
@ericxb: You misunderstand what that line of code is doing. It doesn't prevent sub-themes from using the conditional stylesheets of its base themes; it prevents a 'conditional_styles_' . $theme variable from being built for a theme that is never used on the site.
The
$paths = conditional_styles_paths_to_basetheme($theme);line includes all the conditional stylesheets of a sub-theme's base themes.@jlbretton and @jensimmons: If someone disables a theme, they have visited the admin/build/themes page which causes both the .info file cache and the theme registry to be rebuilt. You both seem to be describing a solution without describing the problem. As Chris' original problem was just problem of not reading the documentation. What problems are you actually seeing?
Comment #6
efc84 commentedEnabling the base theme worked for me too, thanks!
Comment #7
johnalbinWorked for what problem? No one is reading my previous comment. I'm closing this issue in the hopes that the next person who has this problem actually describes the bug they have instead of chiming in with "me too".
Comment #8
efc84 commentedEnabling the base theme will then create the below code
If the base theme is not enabled it will not load the above statement into the source code