| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to detect "Home" page in template files? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi,
What is the easiest way to detect the "home" page inside the template files? I know that there is a variable called $main, but I think there is not any value like "home" for this variable, and also there is another one, $location, but I don't know what exactly is the value for home page. I want to change the layout based on the page structure, I think the layout must be related to the page structure, so I changed the table base layout and used, DIV tags to define different sections and in this case it is very easy to filter the sections, or even columns, based on page structure, so I need to know exactly every possibility for different structures, I found some of them under customer/home_main.tpl, but I am not sure about any other possibility, how can I know how many different structure do we have. Thanks for any help. I am working on 4.0.3
__________________
x-cart 3.5 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() If $main = "" then your on home
![]() eg in smarty {if $main eq ""} Your on home page {/if}
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
#3
|
|||||||
|
|||||||
![]() Quote:
This doesn't work, the reason is, when we are in home page the value of $main is "catalog" not "", but this value is not unique for home page this is the same for product pages may be because they are using "home.php". When we going to cart.php, the $main value changes to "cart", so the value of $main is related to the .php page, so the question is how to know we are in home page, is there any other variable that I can check it, I tried "$location" but, it doesn't say anything in the home page. Is there any way to check the categories? because in the home page there is not any category selected, so I think we can check if the $main value was "catalog" and the category value was "" so we are in home page. Is it correct? How to check the category? Thanks,
__________________
x-cart 3.5 |
|||||||
#4
|
|||||||
|
|||||||
![]() I checked the following code and it is working:
{if $cat eq "0"} As far as I know it works fine, I don't know is there any variable that we can check? Thanks
__________________
x-cart 3.5 |
|||||||
#5
|
|||||||
|
|||||||
![]() this one is work as well:
$main eq "catalog" and $current_category.category eq ""
__________________
x-cart 3.5 |
|||||||
#6
|
|||||||||
|
|||||||||
![]() Quote:
That is the exact way that it is done in /customer/home_maim.tpl to display the welcome template. Code:
|
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|