I'm overriding the front page template using page-front.tpl.php and the conditional-stylesheets I'm settings are not showing up in that template. They work correctly in page.tpl.php. I had to print $conditional_styles directly into page-front.tpl.php.

In mytheme.info:

; Set the conditional stylesheets that are processed by IE.
conditional-stylesheets[if lt IE 8][all][] = ie.css
conditional-stylesheets[if lt IE 7][all][] = fix-ie6.css

In page.tpl.php (using default and works):

<head>
  <title><?php print $head_title; ?></title>
  <?php print $head; ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>
</head>

In page-front.tpl.php (doesn't show conditional styles unless I print manually)

<head>
  <title><?php print $head_title; ?></title>
  <?php print $head; ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>
  <?php if ($conditional_styles) { print $conditional_styles; } ?>
  </head>

Comments

HTB’s picture

Yup same thing here except it's not even zen, it worked for me at first and now... nothing. heres my .info

;description.
name = impale
description = woop woop
core = 6.x
engine = phptemplate

;stylesheets.
stylesheets[all][] = css/layout.css
stylesheets[all][] = css/morph.css
stylesheets[all][] = css/typeset.css

;ie.
conditional-stylesheets[if IE][all][] = css/ie.css

;regions.
regions[left] = left
regions[navbar] = navigation bar
regions[banner] = banner
regions[footer] = footer

apparently the module is triggered when the theme registry is cleared, I've been to the theme section and also used the performance section but to no avail...

I have confirmed that the relevant markup isnt being generated by viewing the page source.

I think this one is a bug...

francewhoa’s picture

Same here. It is not a bug though. This is by design. The following worked for me http://drupal.org/node/321845#comment-1062226

...have you tried copying Zen's page.tpl.php (unmodified) to your subtheme directory as well, then clearing your cache again?

jlbretton’s picture

Title: conditional stylesheets not added when using page-front.tpl.php » conditional stylesheets not added when using page.tpl.php

mmmh... I think is a bug. I don't see any too good logic doing it "by design".
If I look at my <!--[if lte IE 7]><link type="text/css" rel="stylesheet" ... in the generated html pages I see:
a. Drupal doesn't load new ie.css, even if you change the css filename. It keep the old one some where in cache/memory or...? Clearing caches + rebuilding template , with or without the "...have you tried copying Zen's page.tpl.php (unmodified) to your subtheme directory as well" doesn't affect Drupal in my case.
b. Looking at my the generated code line <!--[if lte IE 7]><link type="text/css" rel="stylesheet" ... , I see a wrong path to the file. To make it work I had to
manually print <?php print ('<!--[if IE 7]><link rel="stylesheet" ... into the page.tpl.php, with an absolute machine path to the root server!!! The based Drupal path for the current website is not read. Even a <?php if ($conditional_styles) { print $conditional_styles; } ?> in page.tpl.php is not printed.

Jean

Some more feedback:
a. You need your base theme with the radio button "enabled" check off. "Default" won't be enough, even if your theme seems to work.
b. If you are enabling the theme back or reset to default your theme, it won't work back neither. The solution beeing to manually delete the conditional_stylesheets variable (with Devel or directly on your db) and then only, check off "enabled" the base theme. In this case the module will read and write back in the db the variable wich will make correctly work the module. If for some reason, you deasable the base theme again, you will have to redo all those manipulations.

Jean

johnalbin’s picture

Component: PHP Code » layout.css
Status: Active » Closed (won't fix)

It's a bug in core that can't be fixed in D6.