token condition visibility settings screenshot

This project is not covered by Drupal’s security advisory policy.

Simple token matching condition plugin for Drupal. Compares the value of a given string with tokens with another string (also with tokens), against a regex expression or checking if it's empty.

It can be used in block visibility conditions in the theme block layout, with Page Manager or even with Layout Builder (requires patch from #2916876: Add visibility control conditions to blocks within Layout Builder).

Example conditions:

  • Title contains a string
  • Field value contains a string
  • Field value is empty
  • Current node author is current user
  • Current node author doesn't have a user picture
  • Current node was current in the current month

To be added

Drupal nested field tokens are still being work on #1195874: Need to figure out how to create nested tokens from the array token type / #1222592: Architecture RFC: Field token architecture. Once this finished it should be possible to use much more complex conditions such as:

  • a reference entity doesn't have a value for certain field
  • a referenced entity was created in the current month
Supporting organizations: 
Initial development
D9+ compatible version and current maintaining

Project information

Releases