Support Forums

Old 03-18-2009, 10:46 PM   #1
Junior Member
 
Join Date: Mar 2009
Posts: 10
Rep Power: 1
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   Reply With Quote
Old 03-19-2009, 08:13 AM   #2
Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,313
Rep Power: 39
Mike-N-Tosh is just really niceMike-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
v3.1.10 Developer IndianaPC.org - A community website
Sandbox v4.0.9, 4.1
Templates, Mods & Docs for sale | My blog with much content for 68 Classifieds.
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   Reply With Quote
Old 03-19-2009, 10:49 AM   #3
Moderator
 
 
Join Date: Mar 2008
Posts: 769
Rep Power: 21
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
seymourjames is offline   Reply With Quote

Bookmarks

Tags
banner ads, category, category id

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


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


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