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

Test for home page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-16-2013, 09:01 PM
 
Nora McDougall-Collins Nora McDougall-Collins is offline
 

Member
  
Join Date: May 2013
Posts: 24
 

Default Test for home page

I would like the front page of an X-cart installation to have three columns and the other pages to have two columns. What is the test for the home page?

Here is a model of what I need. I only need the test for the first line.
if(page = home)
three columns
else
two columns

Thanks a bunch!!!
__________________
4.5.5
Nora McDougall-Collins
Montana Webmaster Team
Reply With Quote
  #2  
Old 06-17-2013, 06:59 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Test for home page

Code:
{if $main eq "catalog" and $current_category.category eq ""} { 3 column layout } {else} { 2 column layout } {/if}
HTH
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #3  
Old 06-17-2013, 08:46 AM
 
Nora McDougall-Collins Nora McDougall-Collins is offline
 

Member
  
Join Date: May 2013
Posts: 24
 

Default Re: Test for home page

Thanks so much! It worked!!! I do find it strange that the home page of the shopping cart is "catalog." Is that to differentiate it with the static pages?

I'm just realized I've been a little dense. "eq" means = then. I kept wondering what all the eq's were.
__________________
4.5.5
Nora McDougall-Collins
Montana Webmaster Team
Reply With Quote
  #4  
Old 06-17-2013, 11:56 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Test for home page

Look in home_main.tpl and common_templates.tpl - you can find 90% of the $main values in there
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Nora McDougall-Collins (06-20-2013)
  #5  
Old 06-20-2013, 02:58 PM
 
Nora McDougall-Collins Nora McDougall-Collins is offline
 

Member
  
Join Date: May 2013
Posts: 24
 

Default Re: Test for home page

Excellent lead, Steve! But, it would be helpful if each if in these files - and each file - were commented. For example, what is the scope of the content in "catalog" as compared to "product". I think it would save a lot of time opening files and reading code that ends up not being what someone needs. And, it could save a lot of time asking questions in the forum.
__________________
4.5.5
Nora McDougall-Collins
Montana Webmaster Team
Reply With Quote
  #6  
Old 06-20-2013, 03:44 PM
 
carpeperdiem carpeperdiem is offline
 

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

Default Re: Test for home page

Quote:
Originally Posted by Nora McDougall-Collins
Excellent lead, Steve! But, it would be helpful if each if in these files - and each file - were commented. For example, what is the scope of the content in "catalog" as compared to "product". I think it would save a lot of time opening files and reading code that ends up not being what someone needs. And, it could save a lot of time asking questions in the forum.

If you use webmaster mode, you won't have to ask the forum for your $main eq or other variables.

Webmaster mode has two modes: templates and variables.

It's gonna be your BFF
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
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 05:17 AM.

   

 
X-Cart forums © 2001-2020