View Single Post
  #4  
Old 06-13-2007, 01:58 PM
  Jon's Avatar 
Jon Jon is offline
 

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

Default Re: If else function on home.php

$main and $current_category are both variables.

$main is a variable that is used to tell the internal workings what page to load. When $main eq "catalog" it is either loading the main page, or a category.

When loading a category, the $current_category variable is populated.

So the code I provided loads when the catalog section is loaded (main or category page) and when the $current_category variable is empty (so we know we are on the main page and not a category page).

Yes you can write the opposite, whether or not it will do what you want depends on what you want to accomplish
Reply With Quote