0

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 1

1

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

3
  • Hi Haritha, I need to add drop down field in uiform, which consists category collection. Is this possible in ui-component form
    – Jaisa
    Commented Mar 22, 2018 at 9:13
  • Can you try following the link magento.stackexchange.com/questions/157168/…
    – Haritha
    Commented Mar 22, 2018 at 9:33
  • this solution show html successfully, but can't catch it as a params in save action.
    – fudu
    Commented Dec 22, 2021 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.