Closed (works as designed)
Project:
Conditional Stylesheets
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2010 at 13:47 UTC
Updated:
11 Apr 2012 at 21:26 UTC
Hi,
I've installed the module yet the conditional styles aren't added to the $styles variable.
For now I'm echoing the $conditional_styles variable in the head tag which works fine.
Is this correct behaviour? I thought from reading the project page the conditional css should be in the $styles var?
Cheers
Comments
Comment #1
benalexander commentedHi there,
I've added the following to template.php in hook_preprocess_page:
$vars['styles'] .= $vars['conditional_styles'] = variable_get('conditional_styles_' . $GLOBALS['theme'], '');
... and it sorts the problem. This was found my my colleague, in another thread, but it definitely works for me!
Cheers,
Ben
Comment #2
bartezz commentedHi Ben,
Thanx for that. Still a workaround I guess but if it works :)
Cheers
Comment #3
cashwilliams commentedI had to do this also.
(Using sub-theme of ninesixty)
Comment #4
johnalbinI suspect there is some other module re-writing the $styles variable after this module adds the conditional styles to it.
Comment #5
dgsiegel commentedmaybe it is this line in ninesixty_preprocess_page in template.php:18 of ninesixty?
as you can see, $vars['styles'] gets overwritten
Comment #6
dgsiegel commentedhere is the bug report for ninesixty: #482994: Incompatible with Conditional Styles module
Comment #7
jnettikI'm getting the same thing in drupal 6.22 and conditional styles 6.x-1.2. In terms of what #1 was saying, there already is a variable for $vars['conditional_styles']. I didn't need to create it but it wasn't part of $vars['styles']. My solution was to just print $conditional_styles in my page.tpl.php but I don't know why this was changed.
Comment #8
johnalbinYeah, I can't override what that theme is doing without breaking what its doing.