1

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.

1 Answer 1

4

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.

2
  • in general i do not want to use a custom admin theme at this time. What i want to do is to create an extension with a custom product options type. This requires some new Blocks in admin section. So i have learned that we should not change the magento code to be able to update magento and to have a clean structure. If i place the template in app/design/adminhtml/default/default/template/... isn't it a modification of magentos source files? What happens if i upgrade to a new magento version?
    – steven
    Commented Jan 31, 2014 at 5:34
  • To avoid any issues I would suggest keeping your templates in their own subfolder named after your company/namespace. So unless someone else is using the very same name you are fine. And of course overwriting any existing files is a no go. This approach works across updates since you are not editing any existing Magento core files. Commented Feb 1, 2014 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.