View Single Post
  #3  
Old 10-16-2006, 08:31 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: $main variable... where is it, and how can I use it?

The $main variable is set in various places depending on which file/page is being called. $main is aptly named because it determines what content is displayed in the main content area.

In it's basic form, a php file assigns a $main variable to smarty in the form:

Code:
$smarty->assign("main","something");

This main variable is then read in skin1/customer/home_main.tpl in the form:

Code:
{elseif $main eq "something"} {include file="somefolder/something.tpl"}

somefolder/something.tpl is then a file that displays the content in the main area.

You can use the $main variable in your skin1/customer/home.tpl (or elsewhere) to use distinguishing headers in the form:

Code:
{if $main eq "something"} Show This {else} No Show This {/if}

Hope this helps.
Reply With Quote