I've searched the forums, tried a whole bunch of little hacks, but I have yet to find a solution for the idea I want to implement.
I'm not much of a coder, so I thought maybe someone from the forum could help. Here's an example of what I want to do.
Category 1 - Birds
Category 2 - Cats
Category 3 - Dogs
Let's say I have a site with categories on many different types of pets. I don't, but maybe that's a good idea? Who knows! Anyway, when a person clicks on a story from the Birds category, say "Bird attacks owner with tiny machete", I want a bird-specific ad to show up on the story page.
It would look like this.
Story
Bird Food Ad
Comments
Now, let's say the person surfed over to the story "Cat saves local fireman from tree", which is in the Cats category. Now I want a cat specific banner ad to pop up.
I know I could throw an adsense block right there and I know where to put it in story_center.tpl, so the location is not an issue. I'm more interested in targeting some affiliate programs with this idea.
I've tried writing some conditional {if} statements in story_center.tpl after {$the_story}, but I'm having no luck with getting any category variables to play along with my ruse.
For example:
{if $category_id eq '1' }
ad code
{/if}
Did not produce the desired result. I've tried $category_name, $category_safe_name, $link_category_id, and a few others.
Hopefully, someone understood my meager dream of targeted ads and will come to my rescue.
Thanks!











Linear Mode




