Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I know I need to put ie7.css into the basic.info file list of style sheets, but I don't see where the logic is that tells only the IE7 browsers to look at that stylesheet. Thanks.
Comments
Comment #1
VM CreditAttribution: VM commentedzen theme does conditional stylesheets:
in .info file
That should get you started?
Comment #2
gettysburger CreditAttribution: gettysburger commentedThanks so much. I'll give that a try.
Comment #3
gettysburger CreditAttribution: gettysburger commentedI did some more poking around and found the code in the page.tpl.php file. I added the stylesheets[all][] = css/ie7.css to the basic.info file and viola, I'm in. Lots of thanks to everyone.
Comment #4
grasmash CreditAttribution: grasmash commentedWouldn't that load ie7.css all of the time?
Comment #5
grasmash CreditAttribution: grasmash commentedHm, I don't quite understand. I found this code in page.tpl.php also:
But in IE7, the stylesheet doesn't load. Why is that?
Comment #6
gapa CreditAttribution: gapa commentedFor IE6 i had to change line:
to
Try similar for IE7. And please report back how it goes.
br,
gapa
Comment #7
SteveK CreditAttribution: SteveK commentedhm, maybe M$ depreciated this code? There's also this module: http://drupal.org/project/conditional_styles
Comment #8
EvanDonovan CreditAttribution: EvanDonovan commentedThis still works, afaik - it was working on my version of the Basic theme as of today.
is in my page.tpl.php. Note that the IE 7 line also gets picked up by IE 8 compatibility view.
Neither line will work if there is not a CSS directory in your copy of the theme, or if it doesn't have these files in it, or if the permissions are set incorrectly on them.
If this still isn't working for you, Conditional Styles (as mentioned in #7) is a good alternative.
Marking as fixed. Reopen if more clarification is needed.
Comment #9
david3000 CreditAttribution: david3000 commentedSame issue here guys :(
my page.tpl.php is:
and in my .info file set:
stylesheets[all][] = css/ie7.css
Thanks in advance!!
Comment #10
EvanDonovan CreditAttribution: EvanDonovan commentedLook at the HTML source of the rendered page, and see if the page in the import statement references a file that actually exists. If it does, then check the file permissions. Otherwise, create the file.
Comment #12
Countzero CreditAttribution: Countzero commentedHi all. I'm starting to love this theme and use it as my work base for several projects. I've been very happy with it so far. Thanks for your work on it.
I run into the same problem as the other people above.
I tried the traditional way (basic as is), directly copying the lines into page.tpl.php and front, checked the permissions and accessed the css in the browser, conditonal-stylesheets (with the relevant module installed and enabled), nothing works. Even pasting conditional comments which I know work on another website of mine doesn't work.
What bugs me is that statements get added to the page source, but don't seem to be recognized by IE. I used IE tester and the computed style doesn't mention the dedicated sheets, nor does they appear in the stylesheets list.
I'm still working on this and will update this thread if I find something but as of now, I don't see anything else to try.
In the meantime, any help would be very appreciated (project launch ahead).
Comment #13
Countzero CreditAttribution: Countzero commentedOK, I sort of understood.
It happens I hit the 32 css limit, and got on a false track when reading this bug.
It now works with the conditional style module, so I'll leave it as it is.
You can discard my previous comment. Thanks for reading.
Comment #14
SteveK CreditAttribution: SteveK commentedIf you hit the limit, you can use CSS aggregation to slim it down. Otherwise, check out the http://drupal.org/project/conditional_styles module.
Comment #15
EvanDonovan CreditAttribution: EvanDonovan commentedI believe this functionality made it in to Drupal 7 core, as well, in case that is relevant to you.
Comment #16
Countzero CreditAttribution: Countzero commentedYes that's what I did (aggregation) but it has nothing to do with this issue. Thanks for your replies anyway.
Comment #17
EvanDonovan CreditAttribution: EvanDonovan commentedMarking as fixed.
Comment #18
grasmash CreditAttribution: grasmash commentedI don't see why this issue has been closed. Drupal 7 core may implement aggregation automatically, but that isn't necessarily the cause of this issue. IE7 fails to see the conditional CSS stylesheets even when aggregation is enabled.
In comment 14, SteveK recommends using an additional module as a work around. That module's documentation suggests using the following code in your page.tpl.php file:
Which, adapted to the needs of the Basic theme, would look something like this:
Maybe that modification will fix it. If anyone could try this out and verify, that would be helpful.
Comment #19
EvanDonovan CreditAttribution: EvanDonovan commentedI marked this as fixed based on Countzero's comment in #13, and since other people had reported that it was working. (I have never had this issue myself.)
I misread which module was recommended, though, in #14. I think that IE Unlimited CSS Loader (which allows you to go above the 32 stylesheet limit in Drupal 6, as well as 7, by using @import statements to load the CSS) would actually fix this.
I think I see your point about the dynamic path, although unless you are using Basic as a base theme, that shouldn't be an issue.
I think that it might be better though, rather than using your code from #18, if the Basic theme was reworked to add the conditional stylesheets to the .info file, as the Conditional Stylesheets module does.
Moved to "needs work", since your code is not a patch.
Comment #20
56rosa CreditAttribution: 56rosa commentedHello madmatter23,
I have enabled this conditional_styles module, but in the end, I find it more confusing. I mean that even by clearing the cache in Performance, I can't see any change.
I have:
conditional-stylesheets[if gt IE 6][all][] = css/ie7.css
conditional-stylesheets[if gt IE 7][all][] = css/ie8.css
in the info file. And the page for this module says that it adds automatically the code in page.tpl.php
Well, I don't see it anywhere.
So, I'm thinking of going back to my other solution here: http://drupal.org/node/986318
Except that I cannot somehow attach the css, even if Prajakta's explanation is very good. So, I thought by adding the style css to the info file, it would solve my problem, but then the style for ie8 also shows up in the Firefox browser. So, it's like it's overriding my theme.css then.
So, I dunno right now. I'm getting a bit of a headache trying to make it all work for IE8.
What do you think I should do in the end please?
Thanks a lot
Comment #21
56rosa CreditAttribution: 56rosa commentedHello,
I'm finally seeing my changes: Please see last comment here http://drupal.org/node/986318
Thanks
Comment #22
damiankloip CreditAttribution: damiankloip commentedComment #23
damiankloip CreditAttribution: damiankloip commentedThis is a cross over of another ie stylesheet related issue which has been resolved and committed. I think it is the conditionals in the page.tpl.php file and the 32 file MS limit. Which there is also a solution for (with ie_css_optimizer and conditional_stylesheets)