Ads display when not grouped, but trying to display ads by group doesn't work

evansface - May 1, 2009 - 18:34
Project:Advertisement
Version:6.x-2.0
Component:ad module
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

When I create ads and don't assign them to a group, I can easily display them with the simple

<?php
print ad();
?>

But when I try to put ads in a group (we'll call the group "5") and display an ad with

<?php
print ad(5, 1);
?>

(which is how it says to do it on http://drupal.org/node/394340) nothing shows up. I'm not sure if something is broken or if I'm just doing something stupid (I'm leaning toward the latter). Any ideas?

#1

Jeremy - May 1, 2009 - 21:00
Category:bug report» support request
Status:active» postponed (maintainer needs more info)

You will need to pass in the term_id for your group if calling ad() manually. Is your tid 5? If so, then what you have done should work. If not, then use the tid, not the name of your ad group. One way to find the tid of your group is to go to the ad groups admin page and click "edit" by the group name. Now, look at the path and the # in that path is your tid. (admin/content/ad/groups/#/edit). You only need to pass one parameter, by default it will only display 1 advertisement. In other words, ad(5) and ad(5, 1) mean the same thing.

#2

evansface - May 1, 2009 - 22:31
Status:postponed (maintainer needs more info)» fixed

Using the tid works like a charm - thanks so much Jeremy, you just made my day so much better!

#3

System Message - May 15, 2009 - 22:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.