0

Iam using the following twig code in webform-submission-form--newsletter-signup.html.twig

                        <div class="col-12 col-sm-12 col-md-6">
                            {{ form.elements.url }}
                        </div>
                        <div class="col-12 col-sm-12 col-md-6">
                                {{ form.elements.email }}
                        </div>
                        <div class="col-12 col-sm-12 col-md-12 mt-3 text-center">
                         {{ form.elements.actions }}
                        </div>

                    {{ form.form_build_id }}
      {{ form.form_token }}
      {{ form.form_id }}

and Iam using the following code in webform--newsletter-signup.html.twig

 <form{{ attributes.addClass('subscribe-form') }}>
  <div class="row">

  {{ title_prefix }}
  {{ children }}
  {{ title_suffix }}
  </div>

</form>

When I try to use the default webform templates the message gets displayed after ajax request infact the message is returned as part of the data in response but when I use these templates the message is not present in ajax response what am I doing wrong here please help

0

You need to still include {{ title_prefix }} and {{ title_suffix }} in your template

In the comments in the default webform.html.twig it gives a short description of the default variables "Additional output populated by modules" which includes essentially anything else apart from the form elements themselves

1
  • These two variables already form the part of my webform--newsletter-signup.html.twig file but message is not rendered – user562142 May 5 '20 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.