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

Only on home page?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-09-2006, 10:34 PM
 
Light Speed Light Speed is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 921
 

Default Only on home page?

I want to add an h tag and a div right after body tag but I only want it to display on the home page not on any other pages in the store.

What is the if tag I can wrap my code in to have it only display on the home page?

I don't know what variable to check.
Reply With Quote
  #2  
Old 01-09-2006, 10:45 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Code:
{if $main eq "catalog" AND $cat eq ""} Show Code {/if}
Reply With Quote
  #3  
Old 01-10-2006, 12:21 AM
 
Light Speed Light Speed is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 921
 

Default

Thanks Jon!!
Reply With Quote
  #4  
Old 01-10-2006, 09:13 PM
 
ice cream ice cream is offline
 

Advanced Member
  
Join Date: Jan 2005
Posts: 34
 

Default

Sorry mate, I am new in this field. I also have same needs about this.

Could you tell where/which file should I put these code in? Thanks.
__________________
Cheers,
Ice Cream

Xcart Gold 4.0.17
Fancy Category 4.0.17
Reply With Quote
  #5  
Old 01-10-2006, 10:00 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Where you put the code depends on where you want whatever it is to appear.

Likely either skin1/customer/home.tpl or skin1/customer/main/welcome.tpl
Reply With Quote
  #6  
Old 01-11-2006, 11:17 PM
 
ice cream ice cream is offline
 

Advanced Member
  
Join Date: Jan 2005
Posts: 34
 

Default

Thanks. That's help me.
__________________
Cheers,
Ice Cream

Xcart Gold 4.0.17
Fancy Category 4.0.17
Reply With Quote
  #7  
Old 01-18-2006, 04:45 AM
 
eliasan eliasan is offline
 

Member
  
Join Date: Aug 2004
Posts: 16
 

Default

Thank you! It helped me too.

From where the $main variable is assigned its contents?
Reply With Quote
  #8  
Old 01-18-2006, 08:04 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

skin1/customer/home_main.tpl uses the main variable to determine what contents to display.
Reply With Quote
  #9  
Old 01-18-2006, 08:25 AM
 
eliasan eliasan is offline
 

Member
  
Join Date: Aug 2004
Posts: 16
 

Default

Hi,

Thank you for answering.

Sorry but I will return to my previous question because I think that I didn't get an answer. Maybe my question is silly, but I am a newbie to x-cart customization.

A snapshot from the skin1/customer/home_main.tpl file shows that there is somehow a $main variable that something has put a value in it.

-----------------------------------------------------------
{elseif $main eq "returns"}
{include file="modules/RMA/returns.tpl"}

{elseif $main eq "register"}
{include file="customer/main/register.tpl"}

{elseif $main eq "download"}
{include file="modules/Egoods/main.tpl"}

{elseif $main eq "send_to_friend"}
{include file="customer/main/send_to_friend.tpl"}
-----------------------------------------------------------

That way we can compare if this value is what we need.

My question is from where the $main gets its value, or better what function sets the value of $main.

I have already did a search on x-cart files, but I haven't found an answer...

Thank you in advance for your time and effort.
Reply With Quote
  #10  
Old 01-18-2006, 08:26 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

The main variable is set in the form:

$smarty->assign("main","whatever");

Most of these variable sets are in the main PHP files being called, but some are in the files elsewhere.
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:28 PM.

   

 
X-Cart forums © 2001-2020