Field that retrieves the data, but there is no label and the issue with width
<field name="custom_category_footer_description">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="class" xsi:type="string">Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg
</item>
<item name="formElement" xsi:type="string">wysiwyg</item>
<item name="label" xsi:type="string" translate="true">Custom Category Footer Description</item>
<item name="wysiwyg" xsi:type="boolean">true</item>
<item name="dataScope" xsi:type="string">custom_category_footer_description</item>
<item name="sortOrder" xsi:type="number">36</item>
</item>
</argument>
<formElements>
<wysiwyg class="Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg">
<settings>
<rows>4</rows>
<wysiwyg>false</wysiwyg>
</settings>
</wysiwyg>
</formElements>
</field>
Field that has correct template usage, but doesn't retrieve the data.
<field name="custom_category_footer_description" template="ui/form/field" sortOrder="36" formElement="wysiwyg">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="class" xsi:type="string">Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg</item>
<item name="formElement" xsi:type="string">wysiwyg</item>
<item name="label" xsi:type="string" translate="true">Custom Category Footer Description</item>
<item name="dataScope" xsi:type="string">custom_category_footer_description</item>
<item name="sortOrder" xsi:type="number">36</item>
</item>
</argument>
<formElements>
<wysiwyg class="Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg">
<settings>
<rows>4</rows>
<wysiwyg>false</wysiwyg>
</settings>
</wysiwyg>
</formElements>
</field>
What needs to be changed?
1 Answer 1
<field name="custom_category_footer_description" sortOrder="36" template="ui/form/field" formElement="wysiwyg">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">custom_category_footer_description</item>
<item name="is_pagebuilder_enabled" xsi:type="boolean">false</item> <-- just in case you have one but don't need it there
</item>
</argument>
<settings>
<label translate="true">Custom Category Footer Description</label>
<dataScope>custom_category_footer_description</dataScope>
</settings>
<formElements>
<wysiwyg class="Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg">
<settings>
<rows>4</rows>
<wysiwyg>true</wysiwyg>
</settings>
</wysiwyg>
</formElements>
</field>
-
in my xml layout i have two custom attributes and only the one shows/saves the data depending on their sort order (if the layout is correct and done similarly to core's category_form). once i do the incorrect version (that doesn't have the label), it fetches and saves data for both...Dramorian– Dramorian2025年02月07日 10:44:46 +00:00Commented Feb 7 at 10:44
Explore related questions
See similar questions with these tags.
default