2

Given the following element in my webform, how do I print Name: Fred in my email?

Title   Key   Value
Name    name  Fred

I understand how to print the raw value. How do I print the title?

[?]: [webform_submission:values:name:raw]

An admin may change the element's title, so I can't have Name: [webform_submission:values:name:raw].

0

Accessing a webform's element properties including #title, #description via tokens is not currently supported. I am not sure the core Webform module should provide these tokens, but a third-party module can easily make these tokens available.

  • Yes, for Drupal 8. – 24ma13wg Oct 4 '17 at 14:13
0

You can now use a Twig template. I have an if statement so that the label and colon are omitted if the element is left empty.

{% if data.name %}
  {{ elements.name['#title'] }}: {{ data.name }}
{% endif %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.