I have been using the Conditional Styles module to include an IE-specific css stylesheet. Even though the module is still enabled, after rolling in advagg it seems like my IE stylesheet is not being loaded.

Any suggestions, or do you have a different way to include IE specific stylesheets?

Comments

rjbrown99’s picture

FWIW, in my case advagg has a module weight of 250 and conditional styles has a weight of 0. This was previously working with IE unlimited CSS loader and Conditional Styles with Drupal Core css+js aggregation turned on. I see a few lines of code in advagg.module that deal with conditional_styles, yet they aren't working for me.

My config -
AdvAgg = on
Use in closure = off
Async mode = off
Gzip = off
Generate .htaccess = off (rules are in my root .htaccess)
Regenerate bundles = off
Checksum = md5
No IP for async requests

Under the Information tab, I do not see my ie.css in the list of CSS files.

Bundler = 4 for both CSS and JS

Preserve CSS = on
JSMin+ = on

I'm on 6.x-1.x-dev as of 2011-May-14.

rjbrown99’s picture

I tried to follow along some of the support for labjs and ended up doing this...

In advagg_theme_registry_alter, after the advagg_processor function:

    // If there are conditional styles, move them to the bottom.
    if (module_exists('conditional_styles') && $key = array_search('conditional_styles_preprocess_page', $theme_registry['page']['preprocess functions'])) {
      $theme_registry['page']['preprocess functions'][] = $theme_registry['page']['preprocess functions'][$key];
      unset($theme_registry['page']['preprocess functions'][$key]);
    }

In advagg.install advagg_requirements:

    if (module_exists('conditional_styles')) {
      $function = array_pop($hooks['page']['preprocess functions']);
    }

Rebuild advagg cache, cleared theme registry, and I'm now working.

I'm still unclear on exactly how the module operates but my hack is at least working again for me. Now I get the 4 advagg stylesheets and an unaggregated IE stylesheet.

mikeytown2’s picture

Thanks for the report, will be looking into the best way to do this; yours might be it.

mikeytown2’s picture

Status: Active » Fixed
StatusFileSize
new2.25 KB

Here is the patch I committed. Thanks for the code :)

rjbrown99’s picture

No problem, glad it worked and I was on the right track. I didn't spend a lot of time figuring out how advagg worked but I'm happy I did not have to roll it back.

One other use case - the zen theme makes use of conditional_styles, but it works without the module. It includes a mini module-like function at the theme layer to do the same thing. Might be worth looking at, specifically template.conditional-styles.inc.

http://drupalcode.org/project/zen.git/blob/refs/heads/6.x-2.x:/zen-inter...

The comment at the top explains a bit of their history.

mikeytown2’s picture

Title: Support for conditional stylesheets » Support for conditional stylesheets in zen 2.x
Status: Fixed » Active

Thanks for the heads up, we are still using zen 1.x here; I'll take a look at what's in it.

mikeytown2’s picture

Status: Active » Fixed
StatusFileSize
new1.12 KB

added conditional_styles to the debug output. zen 2.x always worked. Committed this patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.