Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>On the <code>Varien_Data_Form</code> instance you can specify custom element types like this:<br> </p> <pre><code>$fieldset-&gt;addType('custom', 'Your_Module_Model_Form_Element_Custom'); </code></pre> <p>Then, add your element with<br> </p> <pre><code>$fieldset-&gt;addField('the_name', 'custom', $optionsArray); </code></pre> <p>If you are using a form without fieldsets you can do the same on the <code>Varien_Data_Form</code>instance, too.</p> <p><strong>EDIT:</strong> Expand answer because of new additional details in the question.</p> <p>In the class <code>Mage_Adminhtml_Block_Widget_Form::_setFieldset()</code> there is the following code: </p> <pre><code>$rendererClass = $attribute-&gt;getFrontend()-&gt;getInputRendererClass(); if (!empty($rendererClass)) { $fieldType = $inputType . '_' . $attribute-&gt;getAttributeCode(); $fieldset-&gt;addType($fieldType, $rendererClass); } </code></pre> <p>Because of this the attribute <code>frontend_input_renderer</code> on the attributes can be used to specify custom element classes.<br> This property can be found in the table <code>catalog_eav_attribute</code>, and luckily enough it isn't set for any of the category image attributes. </p> <p>Given this, there are several ways to apply customizaton. </p> <p>One option is to simply set the element class in the table using an upgrade script.<br> Another would be using an observer for the <code>eav_entity_attribute_load_after</code> event and setting the input renderer on the fly if the entity_type_id and the input type matches.</p> <p>So it is a little more involved then just regular class rewrites in Magento, but it is quite possible.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload