0

I like to work with tokens a lot. In the node view it works well with the tokens. All tokens are displayed correctly Now I have built a view and in the header of this view I would like to work with tokens. Therefore I built a "contextual filter → Provide default value → Content ID from URL" in my view. Unfortunately it doesn't seem to display all tokens correctly in this view. Tokens like [current:date] are displayed, but [node:title] is not displayed. The contextual filter seems to work correctly, because if I display the title of the node via the normal "Page → Fields → Content: Title", everything works fine and the title of the respective node is displayed correctly. But why are the other tokens not displayed? Does anyone have an idea for me? How do I get this implemented?

Many thanks Bavra

1 Answer 1

3

You only get access to global tokens in Views, anything else takes the form of a "Replacement pattern", and is contextual to the View.

In your case, you need to add the node title to Fields (you can exclude from display if desired), and make sure the "Use replacement tokens from the first row" option is selected for your header:

enter image description here

Then you can simply use

{{ title }}

in the text area.

(You might need to replace title with whatever alias the field is given if different, but the hints should make it easy to choose).

1
  • Thank you, I had not seen that
    – Bavramor
    Jun 13, 2022 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.