Score:0

Not all tokens are replaced

sg flag

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

Score:3
cn flag

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).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.