If you want to load any extension’s block without use layout xml, we can use the widget to make that.
For example: we want to load block type “Magento\Newsletter\Block\Subscribe” – it will been call to block class file “vendor/magento/module-newsletter/Block/Subscribe.php”
Please follow as this:
Widget options:
Addition Class: Custom Block css class, use for custom style for block
Block Type: Input the block type (it will call to module block class), same way of layout xml are calling.
On layout xml, the block are calling as this:
<block class=”Magento\Newsletter\Block\Subscribe” name=”form.subscribe” as=”subscribe” before=”-” template=”Magento_Newsletter::subscribe.phtml”/>
Block Name: input the name for the block as you want.
Block Parameters: You can input there param will use on the block. example:
template=’Magento_Newsletter::subscribe.phtml’
0 Comment