Seems like there should be a way to make blocks visible based on the taxonomy term of the current page. There is already the ability to make visibility conditional with the "Show block on specific pages" option in the block settings. However, what's missing is the ability to display a block on pages, contingent on their taxonomy, and regardless of their page URL. Sure, it would be possible to specify EVERY page in the list, but that isn't practical. You could also put something like "taxonomy/term/5" in the list and the block will show up on the main page for that term, but not on the nodes themselves.

For instance, I'd like to display a block with links relevant to a particular taxonomy term on every page that's classified with that term. That does not appear to be possible, currently.

Comments

icenogle’s picture

I'm also needing this capability.

It seems like you could do this in the block definition itself -- that is, conditionally print content -- presuming you can get the taxonomy terms for the current page. But you're defeated by another problem: You can't turn off the block title, if there is no content for the block. The only trick I know for turning off a block title is through the css file, and that is all or nothing -- not conditional.

I just returned from the 4.7 beta demo, and I see that there is a new block visibility setting, which is "Show if the following PHP code returns TRUE." This could be used to address the taxonomy-based conditonal display of the block.

Still no help on conditional display of block titles, though, that I can see.

jacobson’s picture

I too would find this capability very useful.

marcoBauli’s picture

definitely interested into this too.

+1 for me

find also some juice on the little more advanced request here: http://drupal.org/node/4529

nedjo’s picture

See http://drupal.org/node/20382 for a suggestion on how we could enable this.

nedjo’s picture

Oops, I meant http://drupal.org/node/72195, Pass block.module queries through db_rewrite_sql().

marcoBauli’s picture

guess this issue didn't catch up for 4.8, did it somehow?

lilou’s picture

Version: x.y.z » 7.x-dev
Status: Active » Closed (fixed)
emdalton’s picture

I had this working in D5 with custom php script in the block configuration, and now, thanks to help from eojthebravem, I have it working in D6: http://drupal.org/node/507540

mparker17’s picture

Subscribe. I would really like to see this.

IE938492’s picture

The Context Module solved most of my issues without PHP. Excellent module.

http://drupal.org/project/context