I have webform with fields: name, phone and hidden field product.
For hidden field I use token [current-page:title]
Alll pages of pruduct have the button that pops up a webform.
When submitting a form I would expect that [current-page:title] returns title of the current product page I'm currently on. Instead it points to webform title.
Please tell me how to get a real title?

Comments

ligraf’s picture

1) In webform I create hidden field with token [current-page:query:object]
2) In the node--goods_template.html.twig I place link with pop-up style
<a class="use-ajax contact-form" data-dialog-type="modal" href="/order-object?object={{ node.title.value }}">Make order</a>
(/order-object - webform url)

cdykstra’s picture

Brilliant, thanks ligraf! I wanted to use that title in the confirmation modal, and after creating the hidden field I then used the [webform_submission:values:HIDDEN_FIELD_KEY] token to print out the title of the source page in the Confirmation message RTE.