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

benalexander’s picture

Hi 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

bartezz’s picture

Hi Ben,

Thanx for that. Still a workaround I guess but if it works :)

Cheers

cashwilliams’s picture

I had to do this also.
(Using sub-theme of ninesixty)

johnalbin’s picture

Status: Active » Postponed (maintainer needs more info)

I suspect there is some other module re-writing the $styles variable after this module adds the conditional styles to it.

dgsiegel’s picture

maybe it is this line in ninesixty_preprocess_page in template.php:18 of ninesixty?


  // Make sure framework styles are placed above all others.
  $vars['css_alt'] = ninesixty_css_reorder($vars['css']);
  $vars['styles'] = drupal_get_css($vars['css_alt']);

as you can see, $vars['styles'] gets overwritten

dgsiegel’s picture

here is the bug report for ninesixty: #482994: Incompatible with Conditional Styles module

jnettik’s picture

I'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.

johnalbin’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Yeah, I can't override what that theme is doing without breaking what its doing.