Drupal Answers Asked by LordAro on October 26, 2021
Drupal 8.9, Webforms 5.x
I have a load of forms that are all basically the same, except for the confirmation URL (a download link, essentially) and some minor tweaks to the handlers.
In an effort to reduce duplication, I’ve been looking into the possibility of using variants for this. I can create all the variants easily enough, but I’m at a loss as to how to include these on the correct pages.
The form itself is included in the layout of the content type as a block and I can specify a specific variant there via default submission data (as per image) but that’s a single variant for the whole content type rather than a specific variant for a single page.
What’s the best way to do this? Is it actually possible with variants at all? Or perhaps there’s some other solution I’ve missed
So the eventual answer wasn't variants at all, but webform nodes. Inserting a webform block into the content type's layout enabled me to use the [webform-submission:source-entity:foo]
tokens, which were exactly what I wanted.
Important to note that you have to enable the "Webforms Node" extension for this (I've not seen this mentioned anywhere, so was confused about where the "References" tab was)
Answered by LordAro on October 26, 2021
You could create a hidden redirect URL element, which is then used as the confirmation redirect URL. The hidden redirect URL element can be populated using the 'Default webform submission data.'
Answered by jrockowitz on October 26, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP