I wanted to display some text on a form including the date.
In the fields section, I put
- name: date
label: 'Today is {{ "now"|date("d M Y") }}'
type: display
content: ''
But this was not transformed by Twig.
However, in other parts of a form, I do get a Twig transform. Eg. the following works (I get a file saved including the date.)
process:
- save:
fileprefix: feedback-
dateformat: Ymd-His-u
extension: txt
body: >
{{ "now"|date("d M Y") }}
{% include 'forms/data.txt.twig' %}
A whole load more of string
I realise that the save process goes through another Twig transformation.
I tried to set the site variable 'Process frontmatter Twig' to true, but I got an error originating out of page.php. Unfortunately, I could not get enough debug info to work where the error was, so I turned off this site variable.
I noted that the display field has a markdown option, so I tried twig: true as an option for display but this did not work.
Perhaps a twig: true option could be added to the display field, thus allowing twig processing on the content data?