Blog

Custom Admin Theme

Our Objective

If you need to make adjustments to the adminhtml theme files (template, layout, or skin), you have two options for accomplishing this. Here's an example of what we would want to accomplish: Files in /app/design/adminhtml/default/custom_admin_theme/ need to override files in: /app/design/adminhtml/default/default/ Likewise, files in /skin/adminhtml/default/custom_admin_theme/ need to override files in: /skin/adminhtml/default/default/ The following two options accomplish this functionality:

Option 1 - "Admin Theme" module

Ivan Weiler from Inchoo has created a module that allows you to specify your own custom theme using the same config page you use to specify custom frontend themes. You can download this module here (note: this module is currently in Alpha, so you'll need to modify the setting of your downloader before being able to download it). Here is a screenshot of this module in action: [caption id="attachment_23" align="alignnone" caption=""Admin Theme" Screenshot"]"Admin Theme" Screenshot[/caption]

Option 2 - Add XML to your module's config file

If you don't want to install a module just to enable this functionality, you can add the following XML code inside the tag inside the config.xml file of any of your active modules. Alternatively, you can add this XML to your /app/etc/local.xml file. I prefer this option, due to its simplicity and the fact that the store administrator will have no need to update the adminhtml theme from the admin panel.
<config>
...
    <stores>
        <admin>
            <!-- custom admin theme -->
            <design>
                <theme>
                    <default>custom_admin_theme</default>
                </theme>
            </design>
        </admin>
    </stores>	
...
</config>
The code above overrides the XML from the /app/code/core/Mage/Adminhtml/etc/config.xml lines 410-422
    <stores>
        <admin>
            <!-- default admin design package and theme -->
            <design>
                <package>
                    <name>default</name>
                </package>
                <theme>
                    <default>default</default>
                </theme>
            </design>
        </admin>
    </stores>

Posted on July 11, 2009

Posted by Erik Hansen

Comments

Rizvan's picture

It can be done but you will

It can be done but you will have to code for this. I have not done this before but it can be done.

Mark Hudson's picture

Hi Is it possible to get

Hi

Is it possible to get this to apply different themes depending on the store view being edited in the admin?

Thanks

Mark

Charles's picture

Thanks, I'll try it. -C

Thanks, I'll try it.

-C

Rizvan's picture

It worked for CE as well.

It worked for CE as well. Check for the XML files which loads default theme.

Hugues's picture

@charles, it didn't work in

@charles, it didn't work in your Magento 1.6 CE because of the community extension "Find" located in app/code/community/Find.

A quick way to make it work is to either remove the extension, if you don't use it, or, remove the lines 121 to 129 (included) from the config.xml of the extension:

find

It should work then. Don't forget to clean your cache.

Hope that helped.

-Hugues

Charles's picture

Does this work in 1.6 CE ? I

Does this work in 1.6 CE ? I tried it and I can't get any custom templates to load. :(

Rizvan Vadia's picture

First of all thanks to your

First of all thanks to your guys for providing such informative code. I have also search web for this and fond this use full post. Our problem was we wanted it to be worked for enterprise edition. You code was only to overwrite the theme. Which as not working well for enterprise edition. I have added code to overwrite skin as well and that worked.

Thanks again,
Rizvan

jason's picture

Thx ! Spent ages looking

Thx !

Spent ages looking for this, found loads of wrong ways to do it.
This was simple and it worked

j

Add comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.