Skip to main content

Embed Form in XML Layout

You can call any web-form in layout using following code sample:

Default form widget

<block class="MageMe\WebForms\Block\Form">
<arguments>
<argument name="form_id" xsi:type="string">1</argument>
</arguments>
</block>

form_id - is actual ID of the form.

Button with the form in popup

<block class="MageMe\WebForms\Block\Widget\Button" template="MageMe_WebForms::button/default.phtml">
<arguments>
<argument name="form_id" xsi:type="string">1</argument>
<argument name="button_text" xsi:type="string">Show form</argument>
</arguments>
</block>

form_id - is actual ID of the form.

template - form template which can have following values:

  • button/default.phtml - default template

button_text - text on the button.