Getting started for developers
The short answer
WebForms is a group of Magento modules. MageMe_WebForms holds almost everything: the admin, the builder, storage,
notifications, and the storefront templates and scripts. Companion modules adapt the storefront to Hyvä
and Breeze, and separate modules expose the REST API and GraphQL. The MCP server talks to the REST API. You extend WebForms with the
usual Magento tools, a theme, layout XML, plugins and observers, plus a few extension points WebForms adds for
fields, CAPTCHA providers, documents and integrations. You never edit the module's own files.
How it works
Where to extend
The table names the common tasks. Every extension point, with how far you can rely on it, is listed on Extension points.
The table names the common tasks. Every extension point, with how far you can rely on it, is listed on Extension points.
| You want to | Use | Page |
|---|---|---|
| Make forms look like your theme | The theme style, Hyvä class settings, popup classes | Make forms look like your theme |
| Restyle the popup window | window.mmDialogClasses on Hyvä, a theme rule on Luma and Breeze | Make forms look like your theme |
| Change the markup of a form | A theme template override | Theme and template overrides |
| Restyle forms | The data-wf-* attributes and --wf-* tokens | Styling contract |
| React to a form in the browser | Storefront events, engine hooks, form scripts | Frontend APIs |
| Change the email layouts | Email template overrides | Email template overrides |
| Change PDF layouts | HTML document templates | PDF templates |
| Add a field type | Field type registration | Custom field type |
| Add a CAPTCHA provider | CAPTCHA provider registration | Custom CAPTCHA provider |
| Run code when something happens | Events, plugins and registries | Events, plugins and registries |
| Send submissions to another system | The add-on integration contract | Add-on integration contract |
| Read or change forms and submissions from outside | REST, GraphQL, MCP | REST API |
| Run maintenance from the shell | CLI commands, cron and queues | CLI, cron and queues |
The modules
| Module | Composer package | What it holds |
|---|---|---|
MageMe_WebForms | mageme/module-webforms-base | The product: admin screens, builder, forms, submissions, notifications, PDF documents, CLI commands and cron jobs. Its storefront templates render on Luma and Breeze; its storefront scripts run on every theme. |
MageMe_Core | mageme/module-core | Shared MageMe code: licensing, the storefront script loader and dialogs. WebForms requires ^2.2.2. |
Hyva_MageMeWebForms | mageme/module-webforms-base-hyva | Hyvä templates, Alpine components and the Tailwind sources. It replaces core templates through Hyva_CompatModuleFallback on Hyvä themes only. |
MageMe_WebFormsBreeze | mageme/module-webforms-base-breeze | Script bundles and small fixes for Swissup Breeze. No templates of its own. |
MageMe_WebFormsApi | mageme/module-webforms-api | The REST API, including the Management API that the WebForms MCP server calls. |
MageMe_WebFormsGraphQl | mageme/module-webforms-graphql | The GraphQL schema. |
The WebForms commands sit in the webforms namespace. bin/magento list webforms prints them.
How a form reaches the page
page, widget, CMS block, contact page or slide-out
└─ MageMe\WebForms\Block\Form picks the frame template (form/default.phtml by default)
├─ inline form stylesheet, then form-theme.less (Luma and Breeze)
├─ form/element/form.phtml <form data-wf-part="form" data-wf-contract="1">
│ or form/multistep/form.phtml the same root, with the step strip, for a multi-step form
│ └─ sections → fields → form/element/field/type/*.phtml
└─ <script type="application/json" data-mm-form="<uid>"> the form descriptor
browser: form-controller.js → field scripts → form.js engine → logic → steps → On Load Script
send: POST webforms/form/submit → JSON answer → message, redirect or After Submission Script
On a Hyvä theme the same blocks render the companion's templates, and the same browser scripts run. Templates follow the Magento theme fallback, so your theme can replace any of them.
Layout handles and blocks
| Handle | Page | What WebForms adds |
|---|---|---|
default | Every storefront page | Block webforms_slidedout_form (MageMe\WebForms\Block\SlideOutForm) in after.body.start, only while the global slide-out form is enabled. |
webforms_form_view | A form's own page | Block webforms.form (MageMe\WebForms\Block\Form) in content; the page title block is removed. |
webforms_customer_account | A form's submissions in My Account | Block webforms.customer.account with the list and the form. |
webforms_customer_result | One submission in My Account | Block webforms.customer.account.result.view with the messages and the reply form. |
webforms_result_edit | A customer editing a submission | Block webforms_customer_account_form_edit. |
customer_account | Every My Account page | Navigation block webforms.form.customer.account.navigation in sidebar.additional. |
customer_account_create | The registration page | Clears the stock registration parts while the registration page is replaced by a form. |
A form block takes the form by id. The contact page plugin creates its block the same way:
<referenceContainer name="content">
<block class="MageMe\WebForms\Block\Form" name="northstar.quote.form">
<arguments>
<argument name="form_id" xsi:type="string">12</argument>
</arguments>
</block>
</referenceContainer>
12 stands for your form's id. For content editors the widget WebForms: Form does the same without code.
Extending the form block
A subclass of MageMe\WebForms\Block\Form takes MageMe\WebForms\Block\Form\Context and passes it to the parent
unchanged, then adds its own dependencies. A dependency the base class gains later goes into the Context, so your
constructor stays the same. The Product Options add-on's form block (excerpt):
class Form extends \MageMe\WebForms\Block\Form implements ProductAwareInterface
{
private CatalogData $catalogData;
public function __construct(Context $context, CatalogData $catalogData)
{
parent::__construct($context);
$this->catalogData = $catalogData;
}
}
What this means for you
- Put changes in your theme or your own module. Files under
vendor/mageme/orapp/code/MageMe/are replaced by every update. - Add
MageMe_WebFormsto the<sequence>of your module, so your layout and DI load after it. If you ship the module with Composer, also requiremageme/module-webforms-basein itscomposer.json. - On Hyvä, start a template override from the companion's file, not from the core one.
- Write CSS against the
data-wf-*attributes, not the class names. The attributes are versioned; the classes aren't. - A form template must not print its own executable
<script>. In a popup or a fetched slide-out it never runs, and in developer mode the request fails.
What's next
- Theme and template overrides: replace a template or add CSS on Luma, Hyvä and Breeze.
- Styling contract: the names your CSS can rely on.
- Frontend APIs: the storefront events and the two form scripts.
- Events, plugins and registries: hook into the server side.