Skip to main content
Category:

How to access webform elements in webform.html.twig in Drupal 8 & 9

 


{#
/**
 * @file
 * Default theme implementation for a webform submission form.
 *
 * Available variables:
 * - form: The webform submission form.
 *
 * @ingroup themeable
 */
#}
{# {{ dump(form) }} #}


<div class="webform">
  <div class="form-wrap clearfix">
      <form{{ form.attributes }}>
        {{ title_prefix }}
        <div class="row">
          <div class="col-md-6">
            {{ form.elements.name }}
            {{ form.elements.email }}
            {{ form.elements.contact_number }}
            {{ form.elements.submission_origin }}
          </div>
          <div class="col-md-6">
            {{ form.elements.actions}}
          </div>
        </div>
          {{ form.form_build_id }}
          {{ form.form_token }}
          {{ form.form_id }}
      </form>
    </div>
  </div>
</div>

Riadh Rahmi

Senior Web Developer PHP/Drupal & Laravel

I am a senior web developer, I have experience in planning and developing large scale dynamic web solutions especially in Drupal & Laravel.

Web Posts

Search

Page Facebook