Support Forums

Display Banner Ads based on Category ID

This is a discussion on Display Banner Ads based on Category ID within the Technical Support forums, part of the Technical Support Forums category; I would like to have different banner ads that are triggered by the category ID for the page. The pages ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 03-18-2009, 11:46 PM   #1
Junior Member
 
Join Date: Mar 2009
Posts: 14
Rep Power: 4
rhound is on a distinguished road
Default Display Banner Ads based on Category ID

I would like to have different banner ads that are triggered by the category ID for the page. The pages would be the showlistings and any of the search results. So, for example, if my category ID is 24, I might want to show an ad for dogs. If my category ID is 18, I might want to show an ad for cats. These ads would be above the list of search results displaying either at showlistings.tpl or showlistings2.tpl.

I'd love to get the category number and then do the Smarty logic. What is the variable {$something} that I can grab the category ID on the pages such as search results or even category.php?....

Thank you.
rhound is offline  
Old 03-19-2009, 09:13 AM   #2
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,730
Rep Power: 50
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

The results that are displayed for a search result aren't category specific.

For example, the user types in "brown"

Your results may show:
Category Dogs: Description="A wonderfully friendly brown dog."
Category Cars: Extra Field 'Color'="Dark Brown"
Category Furniture: Description="Nice brown leather high back managers chair"

An FYI: to see what variables are given to any template or displayed page, place "{debug}" in the layout.tpl file of the template that you are using. Make sure that you turn off any pop window blocker that you may have. This built in smarty function will then pop up a separate window displaying all available variables for that page.

Please post your 68 Classifieds type (Designer, Developer), version (4.0.x, 4.1.x) and template in your postings asking for help. This information will help you get better answers for your posts. A great place to do this is in your signature!
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.5)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline  
Old 03-19-2009, 11:49 AM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 1,922
Rep Power: 47
seymourjames has a spectacular aura about
Default

I would do it this way but it is not particularly tidy.

First of all in the showlistings.tpl just test for the $category id, $categoryname or $category and assign the banner adverts you want to display in the place you wish within the showlistings.tpl . For example,

{if $categoryname == "blabla"}

showbanner blabla

{elseif $categoryname == "rara"}

showbanner rara

{elseif $categoryname == "lala"}
.
.

{/if}


Don't see how you can do it for general searchresults as these can come from different categories. As Mike says all the variables for determining which category you are on can be found using {debug}; if you are using
.
__________________
TemplateCodes.com for 68 Classifieds - Magento for Online Stores
seymourjames is offline  
Closed Thread

Tags
banner ads , category , category id

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Banner ads by location or category TimC Pre Sales Questions 1 12-31-2008 12:37 PM
Display Country Flag (based on IP address) against fraud frommarcq v3.1 Modules & Modifications 1 03-11-2008 12:22 PM
Different Payment fees based on Category/Sub-categories Success Pre Sales Questions 1 07-26-2007 08:05 AM
Display Banner in one Category BABBSELA v3.1 Questions & Support 3 02-10-2007 03:22 PM


All times are GMT -4. The time now is 11:40 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0