With Block Visibility Groups, is it possible to display a block everywhere on a site except for one vocabulary?

I expected that if I check one vocabulary and negate the condition, the block would display in all other places on the site, however I found that that restricts the display to only the other vocabularies.

I attempted to achieve this "the other way around", by adding places in a block visibility group, but I could not get the block to display on my media item pages. This "additive" approach also has the disadvantage that one has to remember to edit a condition every time a new content type, vocabulary etc. is added to the site.

I feel like the module could benefit from a 3rd "Negate conditions" radio button on the "Edit Block Visibility Group" page.

CommentFileSizeAuthor
#7 block-visibility-by-vocabulary.PNG16 KBNick Hope
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nick Hope created an issue. See original summary.

scoff’s picture

Same story. I wanted to hide the page title block for a certain content type — no luck so far. It's not very different from what core block visibility rules offer.

Looks like it works like "check is the page IS a node page AND this node IS/IS NOT of type whatever", so it's always false for all other pages (views, user etc.).

Well, in your case it checks for taxonomy term, everything else is the same.

AstonVictor’s picture

There is Block Visibility by Vocabularies module for Drupal 7. You can try to create smth similar or create custom Condition plugin.

Or use Vocabulary condition plugin created by Niklan (just download & enable as a module).
Or you can try Term condition.

mlncn’s picture

[Edit: Sorry, linked to wrong issue originally]

Would #2721381: Allow negation of block visibility group condition resolve this issue?

mlncn’s picture

Category: Support request » Feature request
Status: Active » Postponed (maintainer needs more info)
Related issues: +#2721381: Allow negation of block visibility group condition
Nick Hope’s picture

Sorry for slow answers.

@Aston Victor - Thank you for those suggestions. As far as I can tell, Term Condition only filters by a specific term, rather than a whole vocabulary. Anyway I tried it after applying this patch, which seems necessary, and it's throwing "Undefined index" errors. I may be entering the terms in the wrong format (there is no help on the module's page or in a README). I tried entering /taxonomy/term/604 and just 604.

It seems to me that the functionality in Block Visibility by Vocabularies and the Vocabulary Condition module is now in core. No?

Block visibility by vocabulary

@mlcn - https://www.drupal.org/project/block_visibility_groups/issues/2721381 might help resolve this but I don't know how to test it because the interface is the same after applying that patch. Also, negation of block visibility group conditions is already available (at the bottom of "Add new condition" forms), so I'm a little baffled as to what other type of "negation" the patch adds.

wombatbuddy’s picture

@Aston Victor

Or use Vocabulary condition plugin created by Niklan

Thanks, but It was created by Berdir.

AstonVictor’s picture

@wombatbuddy

ah, sorry :)
just found a link to the plugin in Niklan's post

DamienMcKenna’s picture

Status: Postponed (maintainer needs more info) » Active

I think it'd be worth adding documentation about other modules that provide condition plugins.

DamienMcKenna’s picture

Version: 8.x-1.1 » 2.0.x-dev