• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [Solved]What is correct way to add conditional coment
PostPosted: Sat Jun 02, 2012 8:03 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 536
Location: Western Australia
Using 1.10.3 and latest modules

I need to add a conditional comment (or whatever) to make IE9 display Album lightbox image in the correct place. It is far too low in IE, not nicely in the middle as in FX.

The file in question is "modules/Album/templates/db/default/default.css" and the bit I need to change is
#TB_window {
position: fixed;
background: #ffffff;
z-index: 102;
color: #000000;
display: none;
border: 4px solid #525252;
text-align: left;
top: 50%;
left: 50%;
}

If I change it to "top: 10%" for IE9 it looks OK.

In CMSMS, what do I do and where do I do it?

Thanks


Last edited by jasnick on Mon Jun 04, 2012 12:26 am, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: What is correct way to add conditional coment
PostPosted: Sat Jun 02, 2012 9:36 am 
Offline
Forum Members
Forum Members

Joined: Wed May 23, 2012 12:14 am
Posts: 84
Location: Perth
jasnick wrote:
Using 1.10.3 and latest modules

I need to add a conditional comment (or whatever) to make IE9 display Album lightbox image in the correct place. It is far too low in IE, not nicely in the middle as in FX.

The file in question is "modules/Album/templates/db/default/default.css" and the bit I need to change is
#TB_window {
position: fixed;
background: #ffffff;
z-index: 102;
color: #000000;
display: none;
border: 4px solid #525252;
text-align: left;
top: 50%;
left: 50%;
}

If I change it to "top: 10%" for IE9 it looks OK.

In CMSMS, what do I do and where do I do it?

Thanks

You need another stylesheet for ie9 and an if statement in your template.

http://css-tricks.com/how-to-create-an-ie-only-stylesheet/

_________________
Q. how many hackers does it take to screw in a light bulb?
A. Huh?...What? Oh, it's dark in here?


Top
 Profile  
 
 Post subject: Re: What is correct way to add conditional coment
PostPosted: Sun Jun 03, 2012 12:26 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 536
Location: Western Australia
Thanks SimonJ - I'm not sure if I am tying everything together correctly.I added this to the template:

<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="ie9.css">
<![endif]-->

The ie9.css is the site css plus the adjusted code for #TB_window.
Is that the way to do it?

The result of all that is: FX now showing only half the image - up way too high now and IE is OK. This is on Windows7. So it seems as if not only IE9 is being targetted.

On a test computer with XP/IE7, both FX and IE show the image way too high.

If I remove the conditional comment from the template, XP/IE7 shows both FX and IE7 perfectly. On Windows7, FX is fine but IE9 shows the image way too LOW which is what I was trying to correct originally.

Obviously I am not doing this correctly. ???


Top
 Profile  
 
 Post subject: Re: What is correct way to add conditional coment
PostPosted: Sun Jun 03, 2012 4:34 am 
Offline
Forum Members
Forum Members

Joined: Wed May 23, 2012 12:14 am
Posts: 84
Location: Perth
The ie9.css should only have the extra code, not all the site code as that is still read by everything.

It should do what you need, if not try this http://blogs.msdn.com/b/ie/archive/2010/06/16/ie-s-compatibility-features-for-site-developers.aspx

_________________
Q. how many hackers does it take to screw in a light bulb?
A. Huh?...What? Oh, it's dark in here?


Top
 Profile  
 
 Post subject: Re: What is correct way to add conditional coment
PostPosted: Sun Jun 03, 2012 6:18 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 536
Location: Western Australia
SimonJ wrote:
The ie9.css should only have the extra code, not all the site code as that is still read by everything.


Thanks SimonJ

Have fixed that. Do I attach it to the template as I would any other stylesheet, because when I do that, it fixes IE9 but breaks FX. FX takes on the style I have done for IE9.

Is this absolutely correct for the template:

<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="ie9.css">
<![endif]-->

or should it be more like:

<link rel="stylesheet" type="text/css" href="http://site.org/tmp/cache/stylesheet_7a13b53cbf22f4a1b7bc766d3a453543.css"/>
How do I tell the ID for each stylesheet?

Test computer: XP: IE7 and FX both OK.


Top
 Profile  
 
 Post subject: Re: What is correct way to add conditional coment
PostPosted: Sun Jun 03, 2012 10:05 am 
Offline
Forum Members
Forum Members

Joined: Wed May 23, 2012 12:14 am
Posts: 84
Location: Perth
I am not sure about attaching it, you will need someone with more experience to answer that. Linking to an actual file should work.

So the

<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="ie9.css">
<![endif]-->

Should do assuming the file is in the right place.

_________________
Q. how many hackers does it take to screw in a light bulb?
A. Huh?...What? Oh, it's dark in here?


Top
 Profile  
 
 Post subject: Re: What is correct way to add conditional coment
PostPosted: Sun Jun 03, 2012 3:44 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 11812
Location: Arizona
If you create a stylesheet in the default way, layout > stylesheets, then you can call it in your conditional statement using...

<!--[if IE 9]>
{cms_stylesheet name='ie9'}
<![endif]-->

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get its parameters.
Right click and view source is a great way to see what you have to work with.
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
 Profile  
 
 Post subject: Re: What is correct way to add conditional coment
PostPosted: Mon Jun 04, 2012 12:25 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 536
Location: Western Australia
Thank you Dr.CSS - one again to the rescue!

I see I was calling the stylesheet incorrectly!

Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting