質問

I have a Observer class where i was always used to set new magento template.

<?php

class Company_Customadmintheme_Controller_Observer
{ 
    public function overrideAdminTheme()
    {
        //if(Mage::getStoreConfig('design/admin/enable_admin_custom_theme') == 1)
            Mage::getDesign()->setArea('adminhtml')->setTheme('custom');
    }
}

and in my config xml

<?xml version="1.0"?>
<config>
  <global>
    <models>
        <comapnycustomadminthemecontroller>
             <class>Comapny_Customadmintheme_Controller</class>
        </comapnycustomadminthemecontroller>
    </models>
    <events>
      <adminhtml_controller_action_predispatch_start>
        <observers>
          <comapny_adminthemeoverride_observer>
            <type>singleton</type>
            <class>Comapny_Customadmintheme_Controller_Observer</class>
            <method>overrideAdminTheme</method>
          </comapny_adminthemeoverride_observer>
        </observers>
      </adminhtml_controller_action_predispatch_start>      
    </events>
  </global>
</config>

I have this. Its working fine for Main admin user which was created while installation.

Now we have many admin users who will be able to login and add only products.But for some reason it still showing the magento default template/skin and not picking the custom template(still its working in main admin user who can access all modules/config).

So to make the Catalog users also to see the same template, should i need to specify anything in the xml.

In the observer Class when i tried to see the current template/skin still i see the following array for both users.

object(Mage_Core_Model_Design_Package)#92 (8) {
  ["_store:protected"] => NULL
  ["_area:protected"] => string(9) "adminhtml"
  ["_name:protected"] => string(7) "default"
  ["_theme:protected"] => array(4) {
    ["layout"] => string(6) "custom"
    ["template"] => string(6) "custom"
    ["skin"] => string(6) "custom"
    ["locale"] => string(6) "custom"
  }
  ["_rootDir:protected"] => NULL
  ["_callbackFileDir:protected"] => NULL
  ["_config:protected"] => NULL
  ["_shouldFallback:protected"] => bool(true)
}

Note: My skin/ folder have modifed css for new mage admin and template folder only have page/head.phtml to load extra css.

Please can someone help me in why am not able to see same template for admin/catalog users.

役に立ちましたか?

解決

This is not the right way to use a custom theme for your Backoffice.

Magento already implements this. You just have to put this in any of your config.xml (the one in app/etc or in any of your custom modules.

<?xml version="1.0" encoding="UTF-8"?>
<config>
   <stores>
      <admin>
         <design>
            <theme>
               <default>custom</default>
            </theme>
         </design>
      </admin>
   </stores>
</config> 

With this, Magento will look for your design templates in app/design/adminhtml/default/custom with a failover on app/design/adminhtml/default/default and your design resources in skin/adminhtml/default/custom with a failover on skin/adminhtml/default/default

他のヒント

FIXED IT!

The issue was not in System > Configuration > Design but in fact System > Design I discovered that System > Design had it set up for Default/Shopper and there wasn't a time frame for it. The following link helped me reach my conclusion.

http://www.magentocommerce.com/boards/viewthread/197908/

You are supposed to System > Design for temporary theme changes, but my site had it set with no time frame thus always overwriting my settings in System > Configuration > Design

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top