IE Pain

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Hi i used the Nop dark orange theme but right from the Off it has browser compatibility issues with IE7 or below. It does not display the header menu properly. It is expanded before the user is logged in and should only expand to show the logged in user details. and this just looks poor.

I have searched google for "if ie7" fixes and put them in the header html of the Root.Master but it just seems to have the opposite effect. I tried:-

<!--[if lt IE 8]>

<link rel="stylesheet" href="stylesie7.css"  />

<![endif]-->

Where the link is to another syle sheet that makes pages open correctly in IE7
Did I just put it in the wrong place or is the code wrong?

Surely everyone else has this problem and someone has a fix please?
13 лет назад
Am i just putting the code in the wrong place?
13 лет назад
you wrote it in the right place
but are you sure this css is really loading?

Usually when working with app_themes the css files load automatically. You do not have to specify the path.
13 лет назад
Ok thanks, i get that, but if that doesnt work then how do people get around this issue? surely this is a common problem that lots of people must have solved by now? IE7 is still on a lot of PC's i think.
13 лет назад
no-one?
13 лет назад
Try replacing the doctype in the main master page and see if it helps. The doctype tells the browser how to handle each element on the page and ultimately affects how the browser will render it. I've had better results with 4.01 as shown below. A full list is here: http://www.w3.org/QA/2002/04/valid-dtd-list.html

Replace this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

with this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
13 лет назад
hulio,

the reason why the stylesie7.css is not working, is that it is loaded BEFORE the app_theme main css file.  
Any conditional comments you attempt to apply, are placed (in source code) BEFORE theme's main css and that's why they are not actually working.

What I mean is that app_theme_styles.css styles OVERRIDES stylesie7.css styles.

<!--[if lt IE 8]>
<link rel="stylesheet" href="stylesie7.css"  />
<![endif]-->
<link rel="stylesheet" href="app_theme_styles.css"  />



For some reason nopcommerce loads the theme's css file right before </head> (why???) and there is no way (that I'm aware of) to fix this.

Is it possible to load a css file after app theme css file? Can somebody help us?
13 лет назад
Thanks for that, help still needed then!
13 лет назад
Can someone tell us how to force a contitional comment to be placed after the main theme's css link???
It's a really important issue
13 лет назад
This will require a rebuild.

Go to Header.ascx.cs and place this code in the Page_Load method:
            string myText = "<myscript>this is my script</myscript>";
            if (this.Page.Header != null)
            {
                Literal script = new Literal() { Text = myText };
                this.Page.Header.Controls.AddAt(this.Page.Header.Controls.Count, script);
            }

Remember to replace "myText" with the text of your script. This should place the script AFTER the css for the theme. I just tested it and it worked for me.

BTW, this won't do anything if the page header is null. :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.