| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Adding Content Based on Smarty "IF" Statement | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Adding Content Based on Smarty "IF" Statement
I'm trying to make some customizations to my store, but having a little trouble doing so. I basically want to add or remove call to actions throughout my site depending on what page my visitor is on. So for example, if you look at my store right now: http://www.expresscomputersystems.com/
You'll notice that I have a column on the right that includes a call to action and a few featured products. But, if you go to a product page like this: http://www.expresscomputersystems.com/cisco-npe-g2-processor-pr-18789.html You'll notice that those featured products are no longer in the right column. I use an "if" statement to do it, like this: {if $main eq "catalog" and $current_category.category eq ""} {include file="customer/featured_modifed.tpl" products=$f_products featured="Y"} {/if} {if $main eq "catalog" and $current_category.category ne ""} {include file="customer/featured_modifed.tpl" products=$f_products featured="Y"} {/if} My site was designed by an outside team and I'm not too familiar with Smarty, so I'm really trying to figure all of this out for the first time. I basically need to figure out what these statements do: {if $main eq "catalog" and $current_category.category eq ""} {if $main eq "catalog" and $current_category.category ne ""} I have done a little programming in the past, so I do understand if statements, but it's the Smarty tags that are over my head. If someone can break this statement down for me, I'd appreciate it.
__________________
X-Cart: Version 4.1.9 Apache: Version 1.3.39 (Unix) PHP: Version 5.2.4 |
|||||||
#2
|
|||||||
|
|||||||
Re: Adding Content Based on Smarty "IF" Statement
Those if statements mean:
{if $main eq "catalog" and $current_category.category eq ""} = home page {if $main eq "catalog" and $current_category.category ne ""} = any catalog page except the home page
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
Re: Adding Content Based on Smarty "IF" Statement
Sweet! Thanks balinor.
So what would be the statement for static pages? Or a particular static page?
__________________
X-Cart: Version 4.1.9 Apache: Version 1.3.39 (Unix) PHP: Version 5.2.4 |
|||||||
#4
|
|||||||
|
|||||||
Re: Adding Content Based on Smarty "IF" Statement
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
|||
X-Cart forums © 2001-2020
|