![]() |
If else function on home.php
Hi guys,
I am looking for a code that displays only in home.php example: Quote:
I know php, but am new to smarty.. Basically what I did was I inserted an image tpl right before "welcome" text, but now, the image tpl appears in every page including category page and each individual item page... How can I just display on home.php? |
Re: If else function on home.php
Code:
{if $main eq "catalog" AND $current_category eq ""} |
Re: If else function on home.php
Thankyou!!
What does $main and $current_category mean? That seems like a variable to me..? Also we can write the opposite code too ? Quote:
|
Re: If else function on home.php
$main and $current_category are both variables.
$main is a variable that is used to tell the internal workings what page to load. When $main eq "catalog" it is either loading the main page, or a category. When loading a category, the $current_category variable is populated. So the code I provided loads when the catalog section is loaded (main or category page) and when the $current_category variable is empty (so we know we are on the main page and not a category page). Yes you can write the opposite, whether or not it will do what you want depends on what you want to accomplish :) |
Re: If else function on home.php
Thankyou for your kind answer! Things are getting a little clear once I started to understand the consept. It's still different from standard PHP, so I have a hard time, but hopefully I get it!
Thanks again!!! |
All times are GMT -8. The time now is 06:36 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.