Overriding theme suggestions in Webforms

by raf   Last Updated January 10, 2018 06:07 AM

I have a webform template that will be used to generate a number of forms that will reside in a subsection of my website. The users will create a custom url that is of the form:

www.mysite.com/subsection/category/form-name

I wish to have a custom theme suggestion so I can control the page. How can I alter suggestions so the custom webform page uses a specific theming file:

page__subsection__webform.html.twig 

of something like that.

At the moment the best i can get is:

page__webform.html.twig

which is no good as it affects webforms in other parts of the site.

I can create theme overrides for specific forms:

page__webform__form_a.html.twig

but this is useless as there will be many forms to generate and end users will be the ones doing it.

I have found this discussion of what I think is a similar issue but I cannot seem to implement the solution discussed there.

Any suggestions?

Tags : theming webform


Related Questions



Theming a webform in Twig

Updated March 09, 2017 09:07 AM


How to render a separated webform submission field?

Updated November 14, 2017 16:07 PM

Add unique class to webform radio form-item div

Updated June 03, 2016 08:03 AM