- Issue created by @RobBNL
- Status changed to Fixed
7 months ago 4:11am 18 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.
Hello,
I started working on twig templates only recently and was now trying to get some functionality that I use in content nodes to also to get to work in a twig template.
In my content I use tokens, such as:
[site:name]
[language:langcode]
[node:field_land]
[node:title]
These are all replaced successfully in my output.
I have installed the twig tweak module and I used the following context for these same token replacements:
{{ drupal_token('site:name') }}
{{ drupal_token('language:langcode') }}
{{ drupal_token('node:field_land') }}
{{ drupal_token('node:title') }}
The first two token are replaced succesfully (site name and language code)
But the third and fourth ones are not. One is a custom field that was added to this content type the other one is the node title, which is a default field for any content type.
So this token is in the system and is replaced in my basic-html content when used in a regular node but not when using it in a twig template.
I get this as output:
TestSite
en
[node:field_land]
[node:title]
Any thoughts on what I need to do to get this to work?
Fixed
3.3
Code
Automatically closed - issue fixed for 2 weeks with no activity.