Hi folks,
I have the following interesting problem. Like most people, I want to use conditional comments in my Page.ss template to cater for IE bugs like this:
<head>
...
<!--[if lte IE 7]>
<link href="ie_patches.css" rel="stylesheet" type="text/css" />
<![endif]-->
</head>
I also add custom css files to my page in Page.php like this:
class Page_Controller extends ContentController {
function example() {
Requirements::css("typography.css");
}
}
The problem is that no matter what I do, typography.css will end up AFTER the conditional comment in the generated page.
<head>
...
<!--[if lte IE 7]>
<link href="ie_patches.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="typography.css" >
</head>
I looked at the source of the Requirements class and I noticed that after it assembles the list of required css files, it simply does a eregi_replace() for the closing </head> tag (see file sapphire\core\Requirements.php line 220, I'm using 2.2.2). Of course, I want the conditional comment to appear LAST so that when it comes into effect it overrides the declarations in typography.css. But because of the logic in the Requirements class, it is impossible to do.
I'd appreciate any suggestions on how can I make the conditional comment appear last? This is one of the last problems I need to solve before my site can go live.
Thank you
Csaba