Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

bset

No security coverage
View on drupal.org

Scope entity tokens by bundle so the token only gets replaced if the bundle matches. This module gives you entity tokens, such as [node:field_example], scoped by bundle (called content type in the case of nodes) so that you can use a more specific token. The equivalent, targeted token for an article would be [bset-node-article:field_example]. Other than this scoping, it works identically to a regular entity token.

Features

The motivation to build this module came from the need to distinguish between content of different types provided to FillPDF module, which allows PDF fields to be filled from replacing tokens with values sourced from multiple entities— including entities of a different type. In situations where both a household node and a property node were provided, everything worked as expected: Contact fields were filled from the household and some additional context came from the property. Where only the property node was present, contact information for the property incorrectly was filled in where only household information should be. Hence the need to limit the token used for household fields to households only.

This module can also improve people's experience of selecting tokens with Drupal's token browser by restricting field tokens to the ones applicable to a particular bundle, provided they start with "Bundle-scoped Page Nodes [bset-node-page]" or similar instead of "Nodes [node]".

Post-Installation

Enable the module and go to an interface with a token browser to insert your bundle-scoped tokens.

Note: Some

Additional Requirements

Token module only.

This module would become even more useful to sitebuilders if token module would pass in some additional information, namely bundle in addition to entity type, that it does not presently support. A module which supports token replacement could, where it calls for the "Available tokens" browser, choose to depend on this module and set the token types solicited to only the applicable bundle or bundles, and not regular node tokens at all.

Similar projects

None known.

Supporting this Module

You can support Agaric's overall contributions to Drupal and a bit beyond by supporting Drutopia at opencollective.com/drutopia. Thanks!!

Activity

Total releases
1
First release
Jun 2026
Latest release
21 hours ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev Jun 16, 2026