![]() |
Only on home page?
I want to add an h tag and a div right after body tag but I only want it to display on the home page not on any other pages in the store.
What is the if tag I can wrap my code in to have it only display on the home page? I don't know what variable to check. |
Code:
{if $main eq "catalog" AND $cat eq ""} |
Thanks Jon!!
|
Sorry mate, I am new in this field. I also have same needs about this.
Could you tell where/which file should I put these code in? Thanks. |
Where you put the code depends on where you want whatever it is to appear.
Likely either skin1/customer/home.tpl or skin1/customer/main/welcome.tpl |
Thanks. That's help me.
|
Thank you! It helped me too.
From where the $main variable is assigned its contents? |
skin1/customer/home_main.tpl uses the main variable to determine what contents to display.
|
Hi,
Thank you for answering. Sorry but I will return to my previous question because I think that I didn't get an answer. Maybe my question is silly, but I am a newbie to x-cart customization. A snapshot from the skin1/customer/home_main.tpl file shows that there is somehow a $main variable that something has put a value in it. ----------------------------------------------------------- {elseif $main eq "returns"} {include file="modules/RMA/returns.tpl"} {elseif $main eq "register"} {include file="customer/main/register.tpl"} {elseif $main eq "download"} {include file="modules/Egoods/main.tpl"} {elseif $main eq "send_to_friend"} {include file="customer/main/send_to_friend.tpl"} ----------------------------------------------------------- That way we can compare if this value is what we need. My question is from where the $main gets its value, or better what function sets the value of $main. I have already did a search on x-cart files, but I haven't found an answer... Thank you in advance for your time and effort. |
The main variable is set in the form:
$smarty->assign("main","whatever"); Most of these variable sets are in the main PHP files being called, but some are in the files elsewhere. |
Thank you Jon, I'll do another search on the files based on your latest feedback.
Thank you! P.S. I also run a big forum in Greece, about Mambo (www.mamboclub.net), so I know very well how it is to answer questions to newbies. Please let me thank you twice for your time and patience. |
No problem, I was an x-cart newbie once too :D
|
I have been using X-Cart for three years and on some parts I am a still a newbie 8O :D
Like Jon said the $main is established in the PHP files and it is usually at the very bottom of the file. |
All times are GMT -8. The time now is 04:11 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.