I'm trying to get my own ie.css used instead of the one in the zen folder.
In mysubtheme.info there's this line:
; Set the conditional stylesheets that are processed by IE.
conditional-stylesheets[if IE][all][] = ie.cssI've done nealy everything I can think of to this line and can't get any other output except:
<!--[if IE]>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/zen/ie.css?W" />
<![endif]-->I want to change this output to:
<!--[if IE]>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/mysubtheme/css/ie.css?W" />
<![endif]-->Anyone know how without altering the original zen files.
Comments
Comment #1
johnalbinIn order to override a stylesheet from a module or a base theme, the path to the file (relative to your sub-theme's root) has to match the path to the file in the base theme or module. That's how Drupal core stylesheet overriding works.
So, since Zen has its ie.css in its root directory, you would have to have your ie.css in your sub-theme's root directory (and not in a "css" directory).
However, you can also remove stylesheets from a base theme or module, by specifying it in your .info file, but not including the file in your sub-theme.
So… you can remove Zen's ie.css and then add your css/ie.css like this (in your sub-theme's .info file):
; Remove Zen's ie.css file.
conditional-stylesheets[if IE][all][] = ie.css
; Add the ie.css file from the sub-theme's css directory.
conditional-stylesheets[if IE][all][] = css/ie.css
Comment #2
xstevex commentedThanks for your answer. I tested this here is what my .info file looks like:
But here is my output:
I did clear the cache and the ie.css is actually in the folder. It seems to work for all stylesheets except for the conditional ones.
Comment #3
chris7148 commentedHi xstevex, did you manage to solve this problem? I have a similar issue - none of my subtheme's conditional stylesheet declarations are being included - only those declared in the original Zen theme (I'm using beta 3).
Thanks,
Chris
Comment #4
AaronCollier commentedDoes this issue help at all? #254502: Use my own ie.css
Comment #5
johnalbinI just learned that "clearing the cache" doesn't affect Drupal's storage of the .info file contents. You need to visit admin/build/themes in order for Drupal to re-build that information. Does that fix your problem?
Comment #6
financialgeek commentedI'm having the same issue of my ie.css not being included from the subtheme folder. This is a change from beta2, which subtheme/ie.css was included just fine. I noticed that the beta2 .info file did NOT have the conditional line, these two lines were added in beta3:
So somethings changed from beta2 to beta3.
Comment #7
marcor commentedSame issue here. What further information is needed by the maintainer? Please tell us what is needed, Zen is too cool to lack this. :-)
Comment #8
mndonx commentedIE stops loading stylesheets after 20 (I think that's the limit). If you have more than that, you need to optimize your css, under Settings -> Performance. That has tripped me up before.
Comment #9
mndonx commentedActually, I was wrong: the IE stylesheet limit is 30. BUT I ran into this problem today, and after some time away from the computer, I looked at my admin/build/themes pages and realized that my subtheme was unchecked -- although selected as default. Not sure how that could have happened, but rechecking it solved my problem.
Hope that might help someone!
Comment #10
johnalbinAmanda, I'm glad your issue is fixed. But I don't think it is related to this issue, since the problem here is that the wrong file is being linked to in the HTML.
Marco, the additional info I need is for someone to test all possible fixes that I mentioned above. And then to report back with their results.
I am having no issues in getting an ie.css in my sub-theme. So I need more info from those of you who are having issues.
Comment #11
web360 commentedTo override the default ie.css provided by the Zen "super" theme:
Override Zen's ie.css:
Insert your own:
Note: The new CSS file must exist on your subtheme directory. In my example, the CSS file is found inside a folder named css.
Comment #12
stella commentedI had the same problem, but visiting admin/build/themes fixed it. Thanks @JohnAlbin!
Comment #13
SimonEast commentedI still cannot get this working... I have an "ie.css" file in my subtheme directory.
........
[EDIT]
OK, after 2 hours or more of frustration trying to get this to work, I finally realised that the stylesheets[] array gets refreshed when you just visit /admin/build/themes, however the conditional-stylesheets[] array only gets refreshed once you SUBMIT the form on /admin/build/themes, or you otherwise clear your cache under /admin/settings/performance.
Hope that helps somebody else out there!!
Simon.
Comment #14
bropp commentedThank you! That saved me atleast another hour of frustration.
Comment #15
abbbu commentedThanks a lot SimonEast!!! You saved me lot of frustration....
Comment #16
AaronCollier commentedIt seems fixed now.
Comment #18
dealancer commentedYou also could use Conditional-CSS Integration module, which allows you to use css in a way like this:
Comment #19
dealancer commentedchanging title back
Comment #20
apprayo commented#13 => thanks a lot Simon!