Is there any way we could activate easily the fallback hierarchy mechanism with regards to customized Admin themes, as it already exists for the frontend area?

It is not clear where and how this class, Mage_Core_Model_Design_Package, used for the 'frontend' area, is instantiated, and I was just wondering if we could rewrite and extend it to make it work for the backend as well.

Currently, copying adminhtml/default/default/ files (both for design and skin folders) to adminhtml/package_name/theme_name and then work on these copied files is not a super clean way, and may become complicated with multiple package(s) and/or theme(s) which each bring only some little changes or improvements compare to default/default. It should fallback, I think.

Ideas, anyone?

有帮助吗?

解决方案

There is a bug in Mage_Core_Model_Design_Package::_fallback. It uses the base package as fallback package for the adminhtml area as well. Instead, it should use the default package because no base package exists for adminhtml. You could create a rewrite for the design package model and modify the _fallback() function:

    protected function _fallback($file, array &$params, array $fallbackScheme = array(array()))    
        ...
        $params['_package'] = self::BASE_PACKAGE;
        // otherwise no admin packages with fallback to default package possible
        if ($this->_area == 'adminhtml') {
            $params['_package'] = self::DEFAULT_PACKAGE;
        }
        ...
   }

An alternative solution is to simply rename the folder app/design/adminhtml/default to app/design/adminhtml/base. But I don't know what happens if you're updating to a newer magento version then.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top