How about an option to show advert block based on taxonomy term(s); no match, no show.

There are a number PHP snippets that might do this, and the Block term module, but they all require a knowledge of PHP. For example, see:

Comments

jeremy’s picture

Status: Active » Fixed

Ad groups are taxonomy terms. If you want to show ads by taxonomy, just pass in the appropriate tid when calling ad() (or use the ad_embed module if you don't want to use a PHP block). This should work with ad groups as well as with other taxonomy terms.

iantresman’s picture

Can you give an example of how and where I might do this for one of my own existing taxonomical terms in an advert block? I assume that tid is the taxonomical ID, but I don't know where and how I would pass this when called ad().

jeremy’s picture

Please review README.txt for more details.

If you want to display ads with a tid of 76, then you'd simply call ad(76); If you want to display ads from multiple tids, then you'd call something like ad('76,94,123');

iantresman’s picture

Thanks for that, very useful, but I think we're discussing slightly different taxonomical issues here. If I understand it correctly (and I could be wrong, in which case, my apologies):

  1. Advert groups are effectively ad-specific taxonomical terms (with their own tid), and if I was using PHP, I can choose to display adverts from a particular advert group (identified by its tid), as you've described, and as detailed in the Advert readme.txt documentation.
  2. However, if I want to display an advert block only if one of my own taxonomical terms appears in a node, then I would need to add a bit of PHP code to an advert block's "Page specific visibility settings" to check whether my own taxonomical term is displayed, and as described here

For example, if my Drupal news site displayed a music story with a "music" category term, then I might want to show a music-related advert (ie. the block displays only when the "music" term is showing).

And this is my suggested feature request, an option to show an advert block, only when my own specific taxonomical terms are showing, either:

  • In Edit block advert, an option to select the terms when the ad block will be displayed
  • During "Advert group creation", an option to specify the terms when the group will be displayed.
jeremy’s picture

Status: Fixed » Active

I wonder if this functionality could be built using the views module? If so, this feature request would probably be better applied against the ad_views project.

jeremy’s picture

Project: Advertisement » Ad Views
Version: 5.x-1.5 »
Component: ad module » Code

Re-assigning to the ad_views project, which still needs an owner.

milesgillham’s picture

Version: » 6.x-1.0-alpha2
Status: Active » Closed (won't fix)

At present the ad_views module is intended to be a 'vanilla' implementation of exposing views into the ads tables and fields. I'm going with 'won't fix' due to the age of this, but happy for this to be reopened if still a requirement not satisfied in any other obvious way.

Cheers,

Miles