6

Hey guys, I want to know how to create a custom XHTML system with the custom module or via core file system in Magento 2 & how it works?

2
1

The good choice is use custom module if you need add extra customises.
Inside new module you can define your own template xhtml for your custom ui_component. Use default magento component or reused with additionals is depends on your requirements

Path usually

app/code/YourBrand/ModuleName/view/adminhtml/templates/yourtemplatecomponent.xhtml

With new template. In your custom ui-component defined in layout you can define new template via tag item

<argument name="data" xsi:type="array">
   <item name="template" xsi:type="string">templates/yourtemplatecomponent</item>
</argument>

Example data of htmlContent component default magento

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/ProductVideo/view/adminhtml/ui_component/product_form.xml#L10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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