Hi. Was wondering if anyone knew of a way to display different ads depending on what category the surfer was currently viewing?
I use a banner rotating script that I pull ads from. (phpadsnew) It normally just involves placing a little bit of code on the page you want to display the ads on. You create different zones of ads so only relevant ads get displayed where you want them.
I can edit the wrapper.tpl to put my banner code in, but then it is going to be displaying the same set of banner ads on every page of the site, no matter what category you are in.
Say I had a category called "basketball". I want to be able to display only ads relating to basketball in the category.
Normally I would just set up the banners in phpadsnew and then insert the proper code for each category onto whatever page it was needed, but I don't think that can work in this situation because there is really only the wrapper.tpl to edit.
So if your running 100 Catagories.. and offering 100 seperate banners, 1 per catagory. You'd have to add 100 lines of code, one for each banner code, am I right ?
By that point it makes more sense to get a banner management system, which should allow you to pass some sort of identifier to specify which ad to grab.
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on Changing ad banners based on category
Beginner
Usergroup: Customer
Joined: Sep 26, 2007
Total Topics: 2
Total Comments: 3
Hi. Was wondering if anyone knew of a way to display different ads depending on what category the surfer was currently viewing?
I use a banner rotating script that I pull ads from. (phpadsnew) It normally just involves placing a little bit of code on the page you want to display the ads on. You create different zones of ads so only relevant ads get displayed where you want them.
I can edit the wrapper.tpl to put my banner code in, but then it is going to be displaying the same set of banner ads on every page of the site, no matter what category you are in.
Say I had a category called "basketball". I want to be able to display only ads relating to basketball in the category.
Normally I would just set up the banners in phpadsnew and then insert the proper code for each category onto whatever page it was needed, but I don't think that can work in this situation because there is really only the wrapper.tpl to edit.
Any ideas? Thanks
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
See scripts.webmastersite.net/w...onditionals-syntax-69.html and scripts.webmastersite.net/w...category-variables-11.html
So <IF {CATNAME} is basketball>basketball ads here</IF> (but it's probably better to use id numbers since titles can change).
Member
Usergroup: Customer
Joined: Apr 27, 2004
Total Topics: 5
Total Comments: 17
So if your running 100 Catagories.. and offering 100 seperate banners, 1 per catagory. You'd have to add 100 lines of code, one for each banner code, am I right ?
Hummm
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
By that point it makes more sense to get a banner management system, which should allow you to pass some sort of identifier to specify which ad to grab.