| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Page Specific "If" Statements | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() I know how to make a .tpl file include (or not) on the Homepage by using a specific {if} statement (see below) and another to include somethign based on the category number (also below). But what are the statements I can make for the other pages? For example, what do I write to get a file to include only on the Contact Us page? In my store I have a .tpl file that displays which days the physical store is open. On the contact page, I'd like to include this file on my Contact Us but not on all the other ancillary pages like the cart, or the news page.
IF STATEMENT TO HIDE CART INFO ON HOMEPAGE {if $main ne "catalog" OR ($main eq "catalog" and $current_category.category ne "")} {include file="customer/menu_cart.tpl"} {/if} IF STATEMENT TO SHOW SOMETHING BASED ON CATEGORY {if $cat eq "211"}Show This{/if} I'm quite the newbie getting in and configuring my first store. So far so good. This forum is amazing resource!
__________________
Matthew Stroh Version 4.1.9 |
|||||||||
#2
|
|||||||
|
|||||||
![]()
__________________
xcartmods.co.uk |
|||||||
#3
|
|||||||||
|
|||||||||
![]() Brilliant, PhilJ. I had already read the 'sticky' thread with no help on my specific issue but it was very informative with other {if} statments I'll use eventually. The post about the Webmaster Mode was very, very helpful. For my specific query, I simpy needed to know that the help section is $main eq "help" and webmaster mode showed me that.
__________________
Matthew Stroh Version 4.1.9 |
|||||||||
#4
|
|||||||
|
|||||||
![]() Matthew, are you hip to this thread? It was invaluable to me. Discovering things such as:
{if $main eq "pages" and $page_data.pageid eq "2"} (for static embedded pages) etc...
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#5
|
|||||||
|
|||||||
![]() Take a look at customer/home_main.tpl and for more esoteric stuff common_template.tpl
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
#6
|
|||||||||
|
|||||||||
![]() Quote:
If I am reading this correctly, all you need to do is open the Contact Us template (/skin1/help/contactus.tpl) and insert the line: {include file="yourpathandfile.here"} no if's needed... |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|