X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Only on home page? (https://forum.x-cart.com/showthread.php?t=19148)

Light Speed 01-09-2006 10:34 PM

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.

Jon 01-09-2006 10:45 PM

Code:

{if $main eq "catalog" AND $cat eq ""}
Show Code
{/if}


Light Speed 01-10-2006 12:21 AM

Thanks Jon!!

ice cream 01-10-2006 09:13 PM

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.

Jon 01-10-2006 10:00 PM

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

ice cream 01-11-2006 11:17 PM

Thanks. That's help me.

eliasan 01-18-2006 04:45 AM

Thank you! It helped me too.

From where the $main variable is assigned its contents?

Jon 01-18-2006 08:04 AM

skin1/customer/home_main.tpl uses the main variable to determine what contents to display.

eliasan 01-18-2006 08:25 AM

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.

Jon 01-18-2006 08:26 AM

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.


All times are GMT -8. The time now is 09:03 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.