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.
Comment | File | Size | Author |
---|---|---|---|
#7 | block-visibility-by-vocabulary.PNG | 16 KB | Nick Hope |
Comments
Comment #2
scoff CreditAttribution: scoff commentedSame 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.
Comment #3
scoff CreditAttribution: scoff commentedComment #4
AstonVictor CreditAttribution: AstonVictor at DevBranch commentedThere 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.
Comment #5
mlncn CreditAttribution: mlncn at Agaric for Drutopia, National Institute for Children's Health Quality commented[Edit: Sorry, linked to wrong issue originally]
Would #2721381: Allow negation of block visibility group condition resolve this issue?
Comment #6
mlncn CreditAttribution: mlncn at Agaric for Drutopia, National Institute for Children's Health Quality commentedComment #7
Nick Hope CreditAttribution: Nick Hope commentedSorry 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 just604
.It seems to me that the functionality in Block Visibility by Vocabularies and the Vocabulary Condition module is now in core. No?
@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.
Comment #8
wombatbuddy CreditAttribution: wombatbuddy commented@Aston Victor
Thanks, but It was created by Berdir.
Comment #9
AstonVictor CreditAttribution: AstonVictor at DevBranch commented@wombatbuddy
ah, sorry :)
just found a link to the plugin in Niklan's post
Comment #10
DamienMcKennaI think it'd be worth adding documentation about other modules that provide condition plugins.
Comment #11
DamienMcKenna