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)
-   -   Different Photo based on Page (https://forum.x-cart.com/showthread.php?t=36261)

brandfly 12-18-2007 05:36 PM

Different Photo based on Page
 
Does anyone know how to make it so that I can have a different photo load depending on the page being viewed? For example, I want to have an image on the home page (not part of the welcome.tpl) but not on any other pages. Then depending on the category they visit, have a different photo appear. Is there an easy way to do this with {if} statements?

balinor 12-18-2007 06:12 PM

Re: Different Photo based on Page
 
Yep, follow this thread:

http://forum.x-cart.com/showthread.php?t=8881

brandfly 12-19-2007 05:23 AM

Re: Different Photo based on Page
 
Thanks this helped but I couldn't figure out what I would I put if I wanted something to show up on the home page only? I just need to know how xcart defines the home page.

{if ????????}Insert Home Page Content Here{/if}

balinor 12-19-2007 05:26 AM

Re: Different Photo based on Page
 
{if $main eq "catalog" and $current_category.category eq ""}

home page content only

{/if}

brandfly 01-07-2008 01:59 PM

Re: Different Photo based on Page
 
Cool that worked. I wish I could figure this out on my own. What if I wanted to show something for a specific category, but not when they view the product details. Like when $cat=1 but not when $productid=x.

balinor 01-07-2008 03:52 PM

Re: Different Photo based on Page
 
{if $main eq "catalog" and $cat eq "x"}

replace x with the category number you want to show the image for.

carpeperdiem 01-07-2008 06:12 PM

Re: Different Photo based on Page
 
Although Padraic's answer is correct, that is the long way around...

If you SIMPLY want an image to appear on a category page, put an image tag into the category details.

Click on MODIFY CATEGORY button from the categories management page.

You then have a category DESCRIPTION

Put your html in here.

No ifs needed.

You can also do this for subcats too.

balinor 01-08-2008 04:26 AM

Re: Different Photo based on Page
 
Depends on where you want the image to show...adding it to the category details restricts the image to that area. The {if} statement I posted can be used anywhere....footer, header, side menu, etc.

carpeperdiem 01-08-2008 05:11 AM

Re: Different Photo based on Page
 
Quote:

The {if} statement I posted can be used anywhere....footer, header, side menu, etc.

Of course!

JoeS 06-09-2011 12:53 AM

Re: Different Photo based on Page
 
Quote:

Originally Posted by balinor
Depends on where you want the image to show...adding it to the category details restricts the image to that area. The {if} statement I posted can be used anywhere....footer, header, side menu, etc.


This if statement does not work for me, do you have an updated one please as I am obviously looking at some 3 year old post, I used the following on home.tpl:

{if $main eq "catalog" and $cat eq "3"}
<div align="center">
<a href="http://website url here"><img src="{$ImagesDir}/dpq.gif" width="180" height="288" align="center" alt="DPQ"/></a>
</div>
{/if}


All times are GMT -8. The time now is 03:48 PM.

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