Zen Cart Logo
Forums / General Questions / Banner management

Banner management

Views: 1,683

Results 1 to 5 of 5
21 May 2010, 1:27 PM
#1
shane78 avatar

shane78

Banned

Join Date:
Oct 2008
Location:
newcastle upon tyne (UK)
Posts:
876
Plugin Contributions:
0

Banner management

Hi,

Is there a way to have banners turn off on certain pages? Like how you can have a sidebox showing or not showing depending on the page?

For example, I would like to have some banners only show on the index page.

I have search this site but cannot find the answer :(

21 May 2010, 3:35 PM
#3
shane78 avatar

shane78

Banned

Join Date:
Oct 2008
Location:
newcastle upon tyne (UK)
Posts:
876
Plugin Contributions:
0

Re: Banner management

Hi,

cheers for the link but its the banners i want to be able to switch on and off for some pages... like you can with sideboxes.

Its got me stumped... any ideas?

like Banner Group: header1 to show on main page only
or Banner Group: header2 on checkout pages only

the same concept of sideboxes and left or right column on or off on some pages.,,, but i cant work out with the baners

TShooters:

Try the tutorial here:
https://www.zen-cart.com/tutorials/index.php?article=270

22 May 2010, 6:38 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Banner management

The idea is that there is code doing something somewhere ...

You want something to happen or not happen on the main home page ...

Find the chunk of current code ... make sure you know the starting point and ending point of the code ...

$this_is_home_page

identifies if you are on the Home Page ...

if ($this_is_home_page) {
  // do something I am on home page
} else {
  // do something else I am not on home page
}

So say you want to control a banner ...

Find the code that creates the banner process ...

Find the end of the code that ends the banner process ...

If you add the:

if ($this_is_home_page) {

above the banner code ...

banner code is here
more banner code is here
more banner code is here

and then you close the IF for the $this_is_home_page after the end of the banner code:

} // end of the $this_is_home_page code

then the code inside the new IF can only run when on the home page ...

23 May 2010, 2:28 PM
#5
teob avatar

teob

New Zenner

Join Date:
May 2010
Posts:
13
Plugin Contributions:
0

Re: Banner management

Well, it would be nice if there was a way, when we configure a new banner at banner manager, we could define in which pages this banner would be active or not. For example there could be a field to set up that the banner will be active when the visitor is viewing products in category with id=xxx. That would help the eshop owners (not the administrators, who have the knowledge of programming) to set up the best target-banners.
I suppose that this will be available in later versions of zen-cart (i hope at 1.4...!)