Login | Forgot password | Register
What is OpenID?
OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.
With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.
For more information visit the official OpenID site.
Template Questions
SilverStripe Forums » Template Questions » Trouble with including ie7.css and ie6.css in page.ss
|
Page:
1
|
Go to End | |
| Author | Topic: Trouble with including ie7.css and ie6.css in page.ss | 553 Views |
-
Trouble with including ie7.css and ie6.css in page.ss

19 June 2009 at 12:15pm Last edited: 19 June 2009 2:34pm
So, the theory is that with a condition in your <head> section you can import a CSS file with overrides for IE6 and IE7.
Problem is, the CMS is generating the page with the standard <link rel="stylesheet" ... > tags after the <!-- [IF IE 7]> condition so the precedence is in the wrong order.
Am using SS2.3.1, with <% require themedCSS(layout) %> etc. above the conditional comment in page.ss in a custom theme.
I have tried commenting out Requirements::themedCSS("layout"); etc in page.php as well but the <link rel="stylesheet" ... > still only gets generated immediately before </head>
Same result if I set theme to blackcandy. I have made some changes to page.php but nothing that should cause this.
Only Solution is to remove Requirements::themedCSS("layout"); and <% require themedCSS(layout) %> from page.php and page.ss and hard-code the <link rel="stylesheet" type="text/css" href="http: ... /css/layout.css" /> etc.
Anyone else finding this or any ideas?
Cheers,
Rich
[edit]Have tested original version of page.php (as shipped with 2.3.1 stable build) with same results (after /dev/build)[/edit]
-
Re: Trouble with including ie7.css and ie6.css in page.ss

19 June 2009 at 1:27pm
Yea that's an issue, I get around it by putting this in my Page.php
public function init() {
parent::init();Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
$tags = '
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="themes/example/css/ie6.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="themes/example/css/ie7.css" />
<![endif]-->';
Requirements::insertHeadTags($tags);
}Not ideal but it does the trick
-
Re: Trouble with including ie7.css and ie6.css in page.ss

19 June 2009 at 2:33pm
So it's not just me then, thanks.
I can't find a bug bug raised for this, has it been discussed before? I did search the forum prior to posting but hitting the right keywords isn't guaranteed.
Could someone testing 2.3.2rc check this out perhaps? I'm not really geared-up for beta testing right now and if it's not fixed in v2.3.2 then perhaps it should be.
Nice solution you've posted there but for now I'll stick to hard-coding the css into the template.
Cheers,
Rich
| 553 Views | ||
|
Page:
1
|
Go to Top |
Currently Online: AnthonyP, Jules, Euphemismus, dotperinch
Welcome to our latest member: Jules


