Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have added some containers to my webforms to help segment and control the layout of my forms. Works great.
As part of this, I added element attributes (custom classes) to the containers to help my styling.
I had hoped these element attributes would also be available for the same container elements on the HTML submission pages but they are missing.
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe HTML markup for webform submission is very very basic and does not support custom attributes. I am not sure it makes sense to apply form element class to a submissions markup.
You can override
webform-element-base-html.html.twig
and implementhook_preprocess_webform_element_base_html()
to create any submission markup that you need.@see http://cgit.drupalcode.org/webform/tree/templates/webform-element-base-h...
@see http://cgit.drupalcode.org/webform/tree/includes/webform.theme.inc#n427