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

Different Photo based on Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-18-2007, 05:36 PM
 
brandfly brandfly is offline
 

Member
  
Join Date: Nov 2006
Location: San Diego
Posts: 12
 

Default 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
Reply With Quote
  #2  
Old 12-18-2007, 06:12 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Different Photo based on Page

Yep, follow this thread:

http://forum.x-cart.com/showthread.php?t=8881
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 12-19-2007, 05:23 AM
 
brandfly brandfly is offline
 

Member
  
Join Date: Nov 2006
Location: San Diego
Posts: 12
 

Default 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
Reply With Quote
  #4  
Old 12-19-2007, 05:26 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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
Reply With Quote
  #5  
Old 01-07-2008, 01:59 PM
 
brandfly brandfly is offline
 

Member
  
Join Date: Nov 2006
Location: San Diego
Posts: 12
 

Default 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
Reply With Quote
  #6  
Old 01-07-2008, 03:52 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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
Reply With Quote
  #7  
Old 01-07-2008, 06:12 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default 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
Reply With Quote
  #8  
Old 01-08-2008, 04:26 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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
Reply With Quote
  #9  
Old 01-08-2008, 05:11 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Different Photo based on Page

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

Of course!
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #10  
Old 06-09-2011, 12:53 AM
 
JoeS JoeS is offline
 

Senior Member
  
Join Date: Dec 2008
Posts: 124
 

Default 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}
__________________
xcart gold plus 4.6.5
responsive customized skin
responsive menus
cdseo + on sale + smart predictive search
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 02:56 PM.

   

 
X-Cart forums © 2001-2020