Search
  
Categories
 Last Articles
 Design
 Coding: PHP and Smarty
 Miscellaneous
 Admin Area
 Installation
[add new article]
Making Template Changes to the Front Page Only

Author: phpLD
Added: February 19, 2006

Introduction

If you are looking to put some kind of content on the front page only then here is how you go about doing it.


Code

Just open up one of the template and put this code in here. Using this IF statements allows you to insert code only for the homepage in any of the template files.


{if $category.ID eq 0 and not $p and not $q} 
Place the content that you only want to appear on the fro
 {/if}



"eq 0" means the category is 0
"not $p" prevents anything from appearing on the Top Hits and Latest Links pages.
"not $q" prevents anything from appearing on the search results pages


Using this same principle, you could also choose to make certain content appear only in a specific category.
For example, where the category ID is 1:


{if $category.ID eq 1 and not $p and not $q} 
Place the content that you only want to appear on the fro
 {/if}