I would like to use the t()
helper to show a translated info text in a blueprint.
Like this:
my_field:
type: pages
info: "{{ t(page.intendedTemplate) }}"
Is that possible somehow?
I would like to use the t()
helper to show a translated info text in a blueprint.
Like this:
my_field:
type: pages
info: "{{ t(page.intendedTemplate) }}"
Is that possible somehow?
I don’t really understand the example, because the intendedTemplate is not really something you can translate?
But apart from that, you cannot use the t()
helper but you can create a custom method that returns what you want and inside that method use the t()
helper
I am using the template name as a key to some translated strings.
In the frontend that works like a charm so I style a list of items depending on the template type.
Custom method? In a plugin? Will check the docs tomorrow.