Score:1

Using Twig template to generate a PDF

uz flag

I am trying to generate a Twig template for the Attachment PDF item in a webform. I am able to automatically generate a label and field data using : {{ webform_token('[webform:element:to]', webform) }} : {{ data.to }}

I am trying to figure out how I can get access to the rest of the webform settings such as the labels of the different fields: {{ webform_token('[webform_submission:created]', webform_submission) }}

What if I want to display the title of the form only using label:value? I know I can use : {{ webform_token('[webform_submission:label]', webform_submission) }} but this gives The form name with Submission No attached to the end. I need the form name only.

Is there a command or a setting I can use to get a list of all available settings and fields in the webform?

Sorry if this is not clear enough. Thanks

Score:0
uz flag

I figured how to accomplish what I wanted. It is simply a matter of selecting the proper token :) in this case {{ webform_token('[webform_submission:webform:title]', webform_submission) }}

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.