I am trying to add what will become a slider into the administration area. I have an input box showing (that will eventually hold the slider value) by creating a new attribute in my install script:
$installer->addAttribute(
'catalog_category',
'my_custom_attr',
array(
'label' => 'My Custom Attribute',
'group' => 'My Group',
'type' => 'int',
'class' => 'validate-number',
'required' => false,
'default' => 50,
'renderer' => 'mymodule/adminhtml_catalog_category_widget_slider'
)
);
I need to add some html after the input field has been rendered, so I created this class:
class Mynamespace_Mymodule_Block_Adminhtml_Catalog_Category_Widget_Slider extends Varien_Data_Form_Element_Text
{
public function getAfterElementHtml()
{
$html = parent::getAfterElementHtml();
return $html." <div id=\"slider_track\"><div id=\"slider_handle\"></div></div>";
}
}
The above class resides in app/code/local/Mynamespace/Mymodule/Block/Adminhtml/Catalog/Category/Widget/Slider.php
so should be getting called no problem but no extra HTML is getting added.
frontend_input_renderer
in thecatalog_eav_attribute
for the new attribute you've added? Is is actually populated? I think @oleksii.svarychevskyi is on the right track.