Skip to content

Category Creation Form Customization

I am trying to customize the category page by adding a new section called category faq

enter image description here

To Implement this customization I wrote this category_form.xml file

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="category_faqs">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Category FAQs</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">20</item>
            </item>
        </argument>
        <insertListing name="category_faqs_listing">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="autoRender" xsi:type="boolean">true</item>
                    <item name="externalProvider" xsi:type="string">productandcategoryfaqs_category_question_listing.productandcategoryfaqs_category_question_listing_data_source</item>
                    <item name="ns" xsi:type="string">productandcategoryfaqs_category_question_listing</item>
                    <item name="imports" xsi:type="array">
                        <item name="categoryId" xsi:type="string">${ $.provider }:data.entity_id</item>
                    </item>
                    <item name="exports" xsi:type="array">
                        <item name="categoryId" xsi:type="string">${ $.externalProvider }:params.id</item>
                    </item>
                </item>
            </argument>
        </insertListing>
    </fieldset>
</form>

Now I was asked to show this section only at the subcategories and hide it from the root categories..

Is There any mean to implement that ????