Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Banner on Home page only

Banner on Home page only

Locked

Views: 2,480

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
7 Jun 2006, 1:02 PM
#1
cara_m avatar

cara_m

New Zenner

Join Date:
May 2006
Posts:
10
Plugin Contributions:
0

Banner on Home page only

Can anyone tell me if it is possible to display one of the banners only on the Home Page? I tried moving the banner code from tpl_main_page to tpl_index_default but this didn't seem to work!:smile:
I should probably mention that I can only cope with fairly simple solutions!
Thanks,
Cara.

7 Jun 2006, 8:40 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Banner on Home page only

This thread describes testing for a particular page; it might not be effective for the home page due to its format.

This one describes testing for home page before displaying breadcrumbs; it should be adaptable to your banner display case.

Depending on where you want the home page-only banner, you can add this test inside the other banner display tests ( correct syntax is crucial - a misplaced } will be fatal, and the code must be within the < ?php ? > code areas):

if ($current_page_base == 'index' and $cPath == '') {
  <banner display code>
}

This will only allow the banner display code to execute if on the home page.

8 Jun 2006, 9:24 AM
#3
cara_m avatar

cara_m

New Zenner

Join Date:
May 2006
Posts:
10
Plugin Contributions:
0

Re: Banner on Home page only

Thanks very much Glenn - genius!
If I sound surprised it is not because I lack confidence in your ability, but in mine to put the code in the right place!:laugh: