X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Rotating the Main Image based on categories (https://forum.x-cart.com/showthread.php?t=14157)

ChristineP 01-06-2009 08:14 AM

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>


ChristineP 01-06-2009 08:17 AM

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


ARW VISIONS 01-06-2009 08:35 AM

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>

ChristineP 01-06-2009 08:41 AM

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>


ARW VISIONS 01-06-2009 08:46 AM

Re: Rotating the Main Image based on categories
 
look like there are some quotes mising in the code I posted. it's corrected.

Vetrivel 01-06-2009 08:59 AM

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.


ChristineP 01-06-2009 08:59 AM

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.


ARW VISIONS 01-06-2009 09:02 AM

Re: Rotating the Main Image based on categories
 
please post the code you are using. and a url is you can.

ChristineP 01-06-2009 09:03 AM

Re: Rotating the Main Image based on categories
 
1 Attachment(s)
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>


ARW VISIONS 01-06-2009 09:06 AM

Re: Rotating the Main Image based on categories
 
can you post a URL?


All times are GMT -8. The time now is 07:24 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.