![]() |
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?
|
Re: Different Photo based on Page
|
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} |
Re: Different Photo based on Page
{if $main eq "catalog" and $current_category.category eq ""}
home page content only {/if} |
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.
|
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. |
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. |
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.
|
Re: Different Photo based on Page
Quote:
Of course! |
Re: Different Photo based on Page
Quote:
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.