How to add a custom template for fieldset in ui-component form in magento 2
-
04-01-2021 - |
Pregunta
I have two filed sets in ui component form , Now I wish to Add custom template for one of the field set.Is it possible in uicomponent form to add custom template for a field set. Please provide me a solution
Solución
We can use HtmlContent component for adding a custom template to a UI fieldset
Referred a customer module for adding a template in UI component as follows,
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<htmlContent name="customer_edit_tab_view">
<block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View" name="customer_edit_tab_view" template="Magento_Customer::tab/view.phtml">
<arguments>
<argument name="sort_order" xsi:type="number">10</argument>
<argument name="tab_label" xsi:type="string" translate="true">Customer View</argument>
</arguments>
<block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo" name="personal_info" template="Magento_Customer::tab/view/personal_info.phtml"/>
</block>
</htmlContent>
</form>
Reference: http://devdocs.magento.com/guides/v2.1/ui_comp_guide/components/ui-htmlcontent.html
Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange