Skip to content

How to add htmlContent UI Component in product_form.xml custom attribute product group?

I create a custom product attribute with a custom group like this:

     $eavSetup->addAttribute(
        MagentoCatalogModelProduct::ENTITY,
        'trademark',
        [
            'type' => 'varchar',
            'label' => 'Trademark',
            'input' => 'text',
            'source' => '',
            'frontend' => '',
            'required' => false,
            'backend' => '',
            'sort_order' => '75',
            'global' => ScopedAttributeInterface::SCOPE_STORE,
            'default' => 'No Trademark',
            'visible' => true,
            'user_defined' => true,
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'unique' => false,
            'group' => 'General',
            'used_in_product_listing' => false,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => false,
            'is_filterable_in_grid' => false,
            'option' => array('values' => array("")),
            'group' => 'Meridian'
        ]
    );

I apply a custom group fieldset named Meridian to this custom attribute product.
I tried to add a custom htmlContent UI component to this custom group, by extending product_form.xml in a custom extension like this:

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
     <fieldset name="Meridian"> 
        <htmlContent name="meridian_extended">
            <block name="space-input" class="VendorModuleBlockAdminhtmlProductEditMeridianLocator">
                <arguments>
                    <argument name="template" xsi:type="string">Vendor_Module::catalog/product/edit/meridian-locator.phtml</argument>
                </arguments>
            </block>
        </htmlContent> 
    </fieldset>
</form>

I tried to put the Group name in the fieldset, but when i open the edit product page, the page always becomes blank, when i remove the fieldset the page is there and the html content appears, but it appears at the bottom of the page. I want this htmlContent inside the custom product attribute group, how can i achieve this ?