Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Rotating the Main Image based on categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 01-06-2009, 08:14 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Rotating the Main Image based on categories

Thanks for your reply. Still not working... I don't get an error, however the placement for the image(s) is blank for the height of 153. I've tried adding foreach, but that places all images in order all at once in the headline.

Quote:
Originally Posted by Vetrivel
If you get an error please post that too.So it is easy to debug.
and
TRY THIS:
<div class="HeadLine" style="text-align: left; height: 153px; width: 100%; margin: 10px 0px 0px 0px">
{if $categories[cat_num].categoryid eq "110"}
<img src="{$ImagesDir}/IR_HdrImg.jpg" height="153" border="0" alt="IR Bullet Cameras" />
{elseif $categories[cat_num].categoryid eq "120"}
<img src="{$ImagesDir}/textbanner.jpg" height="153" border="0" alt="IR Bullet Cameras" />
{elseif $categories[cat_num].categoryid eq "130"}
<img src="{$ImagesDir}/IR_HdrImg.jpg" height="153" border="0" alt="IR Bullet Cameras" />
{elseif $categories[cat_num].categoryid eq "140"}
<img src="{$ImagesDir}/textbanner.jpg" height="153" border="0" alt="IR Bullet Cameras" />
{/if}
</div>
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #12  
Old 01-06-2009, 08:17 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Rotating the Main Image based on categories

Thanks for your reply, I copied from the original post here, and X-Cart caught that error when I refreshed my browser.

Quote:
Originally Posted by Ashley
your original code is missing and 'e' in the elseif
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #13  
Old 01-06-2009, 08:35 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Rotating the Main Image based on categories

did you try this?

<div class="HeadLine" style="text-align: left; height: 153px; width: 100%; margin: 10px 0px 0px 0px">
{if $main and $cat eq "110" }
<img src="{$ImagesDir}/IR_HdrImg.jpg" />
{elseif $main and $cat eq "120"}
<img src="{$ImagesDir}/textbanner.jpg" />
{elseif $main and $cat eq "130"}
<img src="{$ImagesDir}/IR_HdrImg.jpg.jpg" />
{else}
<img src="{$ImagesDir}/textbanner.jpg" />
{/if}
</div>
__________________
xcart 5.1.2
Reply With Quote
  #14  
Old 01-06-2009, 08:41 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Rotating the Main Image based on categories

Thanks for the update, still not working. I have my images in both the root Images folder and skin1/images/ folder on my server.

Along with the code you suggested, I also tried the below, but still nothing

<div class="HeadLine" style="text-align: left; height: 153px; width: 100%; margin: 10px 0px 0px 0px">
{if $main and $categoryid eq "110" }
<img src="{$ImagesDir}/IR_HdrImg.jpg" />
{elseif $main and $categoryid eq "120"}
<img src="{$ImagesDir}/textbanner.jpg />
{elseif $main and $categoryid eq "130"}
<img src="{$ImagesDir}/IR_HdrImg.jpg.jpg />
{else}
<img src="{$ImagesDir}/textbanner.jpg />
{/if}
</div>

I know there's something I've missed, and I'll try any suggestions you have.

Thanks again


Quote:
Originally Posted by Ashley
Edit**

try this. make sure you use the <img src /> tag and that your files re in the skin1 images dir

<div class="HeadLine" style="text-align: left; height: 153px; width: 100%; margin: 10px 0px 0px 0px">
{if $main and $cat eq "110" }
<img src="{$ImagesDir}/IR_HdrImg.jpg" />
{elseif $main and $cat eq "120"}
<img src="{$ImagesDir}/textbanner.jpg />
{elseif $main and $cat eq "130"}
<img src="{$ImagesDir}/IR_HdrImg.jpg.jpg />
{else}
<img src="{$ImagesDir}/textbanner.jpg />
{/if}
</div>
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #15  
Old 01-06-2009, 08:46 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Rotating the Main Image based on categories

look like there are some quotes mising in the code I posted. it's corrected.
__________________
xcart 5.1.2
Reply With Quote
  #16  
Old 01-06-2009, 08:59 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Default Re: Rotating the Main Image based on categories

You didnt closed the double quotes of img src
try this:
<div class="HeadLine" style="text-align: left; height: 153px; width: 100%; margin: 10px 0px 0px 0px">
{if $main and $categoryid eq "110" }
<img src="{$ImagesDir}/IR_HdrImg.jpg" />
{elseif $main and $categoryid eq "120"}
<img src="{$ImagesDir}/textbanner.jpg"/>
{elseif $main and $categoryid eq "130"}
<img src="{$ImagesDir}/IR_HdrImg.jpg" />
{else}
<img src="{$ImagesDir}/textbanner.jpg"/>
{/if}
</div>

Quote:
Originally Posted by Ashley
look like there are some quotes mising in the code I posted. it's corrected.
Reply With Quote
  #17  
Old 01-06-2009, 08:59 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Rotating the Main Image based on categories

I have an image showing, and it captures to the last image though it doesn't "rotate/swap" out when I click on a new category. When I changed the image name for the last <img src="{$ImagesDir}/IR_HdrImg.jpg. /> that image showed, making sure that I typed in the correct image name for the required folder.

{else}
<img src="{$ImagesDir}/textbanner.jpg" />
{/if}
</div>

Is there another place that I've missed for this to work?

Quote:
Originally Posted by Ashley
look like there are some quotes mising in the code I posted. it's corrected.
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #18  
Old 01-06-2009, 09:02 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Rotating the Main Image based on categories

please post the code you are using. and a url is you can.
__________________
xcart 5.1.2
Reply With Quote
  #19  
Old 01-06-2009, 09:03 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Rotating the Main Image based on categories

I tried this, and an image does show, but it captures only the last {else} image. When I commented out the last image I still have a blank area for the image, but clicking on those categories listed doesn't show an image see attached. (I placed a temporary border around the area that I want the image to reside.)


Quote:
Originally Posted by Vetrivel
You didnt closed the double quotes of img src
try this:
<div class="HeadLine" style="text-align: left; height: 153px; width: 100%; margin: 10px 0px 0px 0px">
{if $main and $categoryid eq "110" }
<img src="{$ImagesDir}/IR_HdrImg.jpg" />
{elseif $main and $categoryid eq "120"}
<img src="{$ImagesDir}/textbanner.jpg"/>
{elseif $main and $categoryid eq "130"}
<img src="{$ImagesDir}/IR_HdrImg.jpg" />
{else}
<img src="{$ImagesDir}/textbanner.jpg"/>
{/if}
</div>
Attached Thumbnails
Click image for larger version

Name:	HeadlineImg.jpg
Views:	61
Size:	55.8 KB
ID:	1311  
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #20  
Old 01-06-2009, 09:06 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Rotating the Main Image based on categories

can you post a URL?
__________________
xcart 5.1.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:45 AM.

   

 
X-Cart forums © 2001-2020