ProStores Discussion Board  

Go Back   ProStores Discussion Board > Product Discussion > Store Design

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2009, 09:04 AM
mppanj12 mppanj12 is offline
Senior Member
 
Join Date: Jan 2006
Posts: 822
Default Need Help With SS:if Statement

Hey Folks,
I need a statement that will use one photo for IE and another for FF, I am trying this on my homepage but is not working. Any ideas are much appreciated.

Code:
<ss:if test="IE 7">
     <table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" style="border:0px solid #660000;padding:2px;">
<ss:link source="$templateset.templates['Coffeesale']">
<ss:image source="$storeVersion.images['coffeesale6.jpg']" width="645" alt="Coffee Sale" border="0"/></ss:link>
</td>
</tr>
 
<ss:else/>
 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" style="border:0px solid #660000;padding:2px;">
<ss:link source="$templateset.templates['Coffeesale']">
<ss:image source="$storeVersion.images['coffeesale6.jpg']" width="100%" alt="Coffee Sale" border="0"/></ss:link>
</td>
</tr>
</ss:if>
Thanks
Matt
Reply With Quote
  #2  
Old 10-08-2009, 12:22 PM
TylerD's Avatar
TylerD TylerD is offline
ProStores Staff
 
Join Date: Oct 2005
Location: CA
Posts: 562
Default

This should do it.

Code:
<ss:if test="$browser.isMsIe()">
This is IE
<ss:else/>
This is NOT IE... Is Firefox, Opera, Chrome...
</ss:if>
If you are looking for somehting specific to IE 7 or higher then use this.

Code:
<ss:if test="$browser.isMsIe7OrGreater()">
This is IE 7, IE 8
<ss:else/>
This is IE6 , Firefox, Opera, Chrome...
</ss:if>

Last edited by TylerD; 10-08-2009 at 12:31 PM.
Reply With Quote
  #3  
Old 10-09-2009, 06:40 PM
mppanj12 mppanj12 is offline
Senior Member
 
Join Date: Jan 2006
Posts: 822
Default

Thanks Tyler,
Works Awesome.
Reply With Quote
  #4  
Old 11-02-2009, 03:58 PM
dwa12479 dwa12479 is offline
Senior Member
 
Join Date: Oct 2008
Posts: 664
Default

Hey Matt,

I think I have an easier way for you to accomplish your goal without the need for an <ss:if> statement or redundant code. It looks like the only thing that you're trying to add for IE is the border and width provisions for your images. IE is the only browser that can read conditional statements, so you can feed different CSS to IE. Here's how I would do it:

1) Create a new notepad file, and save it as ie.css. Add the code below and upload it to your store images folder.
Code:
img.ieOnly  { 
     width:642px;
     border:none;
}
2) Add the conditional statement that feeds the external stylesheet as the very last line in your header template above the </head> tag:
Code:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="$storeVersion.images['ie.css']" />
<![endif]-->
3) Remove the test statements, the width and border provisions, and replace them with the class ieOnly, so your code will look like this:
Code:
<div id="slideshow">
<div class="active">
<a href="http://">
<ss:image source="$storeVersion.images['coffeesale6.jpg']" class="ieOnly" alt="30% Coffee Sale" /></a>
</div>
<div>
<a href="http://">
<ss:image source="$storeVersion.images['saeco.jpg']" class="ieOnly" alt="Saeco Venus + Pumpkin Spice" /></a>
</div>
<div>
<a href="http://">
<ss:image source="$storeVersion.images['wholesalecoffee.jpg']" class="ieOnly" alt="Wholesale Coffee" /></a>
</div>
<div>
<a href="">
<ss:image source="$storeVersion.images['logocontest.jpg']" class="ieOnly" alt="Join Our Logo Contest" /></a>
</div>
</div>
Now Firefox will read the code and display the image at the height and width that it was uploaded at. It will not find the ieOnly class anywhere, so it will simply ignore it. IE on the other hand, will read the CSS from the external sheet because it's enclosed in the conditional statement.
__________________
Dave
http://www.ExtremeAudioDeals.com
Reply With Quote
  #5  
Old 11-03-2009, 06:54 PM
mppanj12 mppanj12 is offline
Senior Member
 
Join Date: Jan 2006
Posts: 822
Default

Dear Dave,
I implemented your code and I think it works, I have this problem that whatever IE shows thats what shows in FF. Or if I open FF first than thats what I see in IE, is there anyway to make these two different browsers not share info.

Thanks
Matt
Reply With Quote
  #6  
Old 11-03-2009, 07:00 PM
dwa12479 dwa12479 is offline
Senior Member
 
Join Date: Oct 2008
Posts: 664
Default

Are you using the preview function?
__________________
Dave
http://www.ExtremeAudioDeals.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.