| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Different Photo based on Page | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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?
__________________
Thanks. Dustin // Captain [ BrandFly ] Design & Other Creative Stuff BrandFly.com X-Cart Gold v4.1.1 |
|||||||
#2
|
|||||||
|
|||||||
Re: Different Photo based on Page
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
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}
__________________
Thanks. Dustin // Captain [ BrandFly ] Design & Other Creative Stuff BrandFly.com X-Cart Gold v4.1.1 |
|||||||
#4
|
|||||||
|
|||||||
Re: Different Photo based on Page
{if $main eq "catalog" and $current_category.category eq ""}
home page content only {/if}
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
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.
__________________
Thanks. Dustin // Captain [ BrandFly ] Design & Other Creative Stuff BrandFly.com X-Cart Gold v4.1.1 |
|||||||
#6
|
|||||||
|
|||||||
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.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#7
|
|||||||
|
|||||||
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.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#8
|
|||||||
|
|||||||
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.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#9
|
|||||||
|
|||||||
Re: Different Photo based on Page
Quote:
Of course!
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#10
|
|||||||
|
|||||||
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}
__________________
xcart gold plus 4.6.5 responsive customized skin responsive menus cdseo + on sale + smart predictive search |
|||||||
|
|||
X-Cart forums © 2001-2020
|