This project is not covered by Drupal’s security advisory policy.
Vocabulary Condition provides taxonomy-based visibility conditions for blocks. The conditions can be used when configuring visibility rules on the Block Layout page, or anywhere the core condition plugin API is available (for example, with the Context module).
Which version should I use?
The recommended version is 2.x, which goes beyond what Drupal core offers:
- Vocabulary or term: applies on taxonomy term pages. It matches whole vocabularies (as core does), and additionally specific taxonomy terms, optionally including all of their descendants. Ideal for section-based block placement: blocks assigned to a section keep working automatically when new child terms are created.
- Content tagged with vocabulary: applies on content pages. It shows a block on every node tagged with a term of the selected vocabularies, with specific terms, or with any of their descendants. Drupal core provides no taxonomy-based block visibility for content pages at all.
Vocabularies and terms are combined with OR, and the conditions collect the proper cache metadata so that changes to the term hierarchy invalidate cached results. The 2.x branch requires Drupal 10.3, 11 or 12.
How it differs from Drupal core
Since Drupal 9.3, core includes the functionality this module originally provided: the generic entity bundle condition exposed for taxonomy terms and the taxonomy term route context. The 2.x branch goes beyond that in two ways:
- It adds matching by specific taxonomy term, optionally including all of its descendants. This keeps section-based block placement working automatically when new child terms are created, something the core "Vocabulary" condition does not do.
- It adds taxonomy-based block visibility on content (node) pages, which Drupal core does not provide at all.
If you only need to match whole vocabularies on taxonomy term pages, you do not need this module: use the core "Vocabulary" condition instead.
The 1.x branch is not recommended
The 1.x branch predates the core functionality and is kept only for compatibility with existing sites. It will receive no new features. New installs should use 2.x, or plain Drupal core if the core condition is enough.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Access control, Site structure
217 sites report using this module
- Created by trebormc on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
