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)
-   -   Edit <head> of home page (https://forum.x-cart.com/showthread.php?t=67180)

snowboard 06-23-2013 02:47 AM

Edit <head> of home page
 
Hello,

How do you do an if statement to add content to the head section of the home page only?

I know to add to category page, you use {if $cat eq "xxx"} CODE {/if}

But how do you do an if statement for the home page?

Thanks!

carpeperdiem 06-23-2013 04:36 AM

Re: Edit <head> of home page
 
Quote:

Originally Posted by snowboard
Hello,

How do you do an if statement to add content to the head section of the home page only?

I know to add to category page, you use {if $cat eq "xxx"} CODE {/if}

But how do you do an if statement for the home page?


You can determine any page variable by using webmaster mode.

xcart_admin > Tools > Webmaster mode

Not only can you see the template structure, you can also see the variables.
$main is the variable that you want to analyze.

Additionally, if you evaluate the file,
/skin/common_files/customer/home_main.tpl
you will be able to see many of the $main if statements that already are working for you...

the default $main for the home page is:
Code:

{elseif $main eq "catalog" and $current_category.category eq ""}
{include file="customer/main/welcome.tpl"}

which calls welcome.tpl into the main section.

BUT - I hope you don't have to ask for a $main variable here again -- the power is right in front of you!!!


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

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