Problem/Motivation

When browsing tokens for a specific bundle (which is 98% of the time), it would be a big usability boost to only see fields that belong to that bundle.

And, a bit more of an edge case, there are uses where different entities may be the source of token replacements but you would only want [node:label] to do its thing and give you the title if the source entity were an article and not a page, so [nodebundle:article:label] or something like that, while [nodebundle:page:label] would only be filled when a node of type page is available. This is the case for FillPDF and its use of tokens: #3591673: Scope field token replacement to a bundle

Steps to reproduce

Proposed resolution

Both these use cases could be addressed by providing scoped tokens, either under node [node:article:label] or maybe directly as the bundle machine name [article:label] but that would presumably have risk of namespace collisions, or else (safest?) under a separate namespace, say [nodebundle:article:label]

Remaining tasks

Decide if this would be accepted into token module, and then how the namespace should work.

User interface changes

Yet more tokens, but once you are in the tree for your bundle you only see the fields relevant to your bundle.

API changes

Data model changes

Comments

mlncn created an issue.