Where to Place Templates of an Adminhtml Block in Magento

adminhtmlextensionstemplate

I have a custom design called mydesign and a custom extension (My_Testmodule).

if i create the following block in my own module:

class My_Testmodule_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Test extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract {

    public function __construct() {
        parent::__construct();
        $this->setTemplate('mydesign/catalog/product/edit/options/type/test.phtml');
    }

}

where should the template be located?

should it be in

  • app/design/adminhtml/mydesign/default/template/testmodule/catalog/product/…
  • app/design/frontend/mydesign/default/template/testmodule/catalog/product/…
  • or somewhere else?

i thought it should be in adminhtml/... but it doesn't seems to be called. The Block is definitly beeing called, if i echo something in constructor it will be printed on screen. But the template seems to be ignored.

Please help me, im struggeling arround with it since hours.

Best Answer

By default Magento does not offer a package/theme setting for the admin section and it uses default/default

Placing your template into
app/design/adminhtml/default/default/template/mydesign/catalog/product/edit/options/type/test.phtml should do the trick.

Theme fallback also works so you can use
app/design/adminhtml/base/default/template/mydesign/catalog/product/edit/options/type/test.phtml
as well, but I haven't seen base used widely for admin themes yet.

Further reading
If you want to be able to use a custom admin theme (app/design/adminhtml/mydesign/default/) please see this blog post outlining different options.

Related Topic