-
Notifications
You must be signed in to change notification settings - Fork 9
Display Widget Form Programmatically
Its possible to display Widget Form programtically on frontend.
You can display form by Form Id or by Form Identifier:
- Form Id - entity id from database
- Form Identifier - editable identifier, which can be set to any post by admin (General tab on manage form view)
|
Note: widget form will be visible on frontend ony if "Can use as frontend widget" is "Yes".
Example:
<referenceContainer name="content">
<block class="Alekseon\WidgetForms\Block\WidgetForm" name="myForm">
<arguments>
<argument name="form_identifier" xsi:type="string">my_form_code</argument>
</arguments>
</block>
</referenceContainer>
Alternatively you can use id instead of identifier:
<argument name="form_id" xsi:type="string">1</argument>
Optionally You can use below params:
<argument name="hide_description" xsi:type="boolean">true</argument>
<argument name="hide_title" xsi:type="boolean">true</argument>
By Form ID
echo $block->getLayout()->createBlock('Alekseon\WidgetForms\Block\WidgetForm')
->setFormId(1)
->toHtml();
or by Form code
echo $block->getLayout()->createBlock('Alekseon\WidgetForms\Block\WidgetForm')
->setFormIdentifier('my_form_code')
->toHtml();
Composer Packages
Installation & Updates
Videos
Demo
Ask About Product
Multi-step Survey (soon)
Edit Form View
Creating new Form
Insert Form Widget
Form Input Types
reCAPTCHA Validation
New Entity Notification Email
Confirmation Email
Newsletter Subscription
Form Statistics
Permissions (soon)
Text Field
Text Area
Yes/No
Dropdown
Multiple Select (soon)
Date
Image (soon)
Rating
Field Advanced Settings (soon)
Input Validators (soon)
Default Values (soon)
Field Option Source
Template Variables
Display Widget Form programmatically
How to use form record in Custom Module
Custom Options Source
Input Params
Template overrides (soon)
Events List