Displaying images in magento extension backend -
i developing extension , want display images on extension backend page. have stored images in 'images' folder in extension. trying show images using <img> tag. have provided image url in "src" attribute, not showing image @ backend page. in system.xml, using following code:-
<myoption translate="label"> <label>my label</label> <frontend_type>radios</frontend_type> <source_model>mymodule/source_buttons</source_model> <sort_order>30</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </myoption> code in model\source\buttons.php file:-
<?php class mycompany_mymodule_model_source_buttons { public function tooptionarray() { $result = array(); $result[] = array('value' => '32', 'label'=>'<img src="'.mage::getmoduledir('', 'mycompany_mymodule').ds.'skin'.ds.'images'.ds.'img32.png" />'); $result[] = array('value' => '16', 'label'=>'<img src="'.mage::getmoduledir('', 'mycompany_mymodule').ds.'skin'.ds.'images'.ds.'img16.png" />'); return $result; } } on extension backend page, showing:-
<img src="c:\wamp\www\magento\app\code\community\mycompany\mymodule\skin\images\img32.png"> but src attribute value linking :-
http://mydomain/magento/index.php/admin/system_config/edit/section/mymodule_options/key/b834efa05ef37070c94d28c6b44e4bf0/c:/wamp/www/magento/app/code/community/mycompany/mymodule/skin/images/img32.png please help...
try this:
echo $this->getskinurl(); you can path images.
Comments
Post a Comment