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
1 Answer
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
-
Hi Haritha, I need to add drop down field in uiform, which consists category collection. Is this possible in ui-component form– JaisaCommented Mar 22, 2018 at 9:13
-
Can you try following the link magento.stackexchange.com/questions/157168/…– HarithaCommented Mar 22, 2018 at 9:33
-
this solution show html successfully, but can't catch it as a params in save action.– fuduCommented Dec 22, 2021 at 9:07