Magento Forum

   
Page 1 of 2
How do I change the admin theme? 
 
Tweakmag
Guru
 
Avatar
Total Posts:  307
Joined:  2007-08-31
London, UK
 

i copied ‘app/design/adminhtml/default/default’ -now is there a way to tell magento to use the new location for the admin area??

 
Magento Community Magento Community
Magento Community
Magento Community
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

Anyone have an answer for this? I am trying to do the same thing.

-Bryan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Right now the only way to configure which theme admin will use is in
app/code/core/Mage/Adminhtml/Controller/Action.php::preDispatch

Mage::getDesign()->setArea('adminhtml')
            ->
setPackageName('default')
            ->
setTheme('default');

 
Magento Community Magento Community
Magento Community
Magento Community
 
perlinux
Jr. Member
 
Total Posts:  4
Joined:  2008-01-22
 
Moshe - 19 November 2007 03:03 PM

Right now the only way to configure which theme admin will use is in
app/code/core/Mage/Adminhtml/Controller/Action.php::preDispatch

Mage::getDesign()->setArea('adminhtml')
            ->
setPackageName('default')
            ->
setTheme('default');

app/code/core/Mage/Adminhtml/Controller/Action.php on 0.9.17740 has:
->setTheme((string)Mage::getConfig()->getNode(’stores/admin/design/theme/default_clean’));

Where do I set the value for ‘stores/admin/design/theme/default_clean’?

 
Magento Community Magento Community
Magento Community
Magento Community
 
perlinux
Jr. Member
 
Total Posts:  4
Joined:  2008-01-22
 

For 0.9.17740,
Mage_Adminhtml_Controller_Action::preDispatch sets theme with the value:

(string)Mage::getConfig()->getNode('stores/admin/design/theme/default_clean')

you can set the value at app/code/core/Mage/Adminhtml/etc/config.xml:

<stores>
        <
admin>
            <!-- default 
admin design package and theme -->
            <
design>
                <
package>
                    <
name>default</name>
                </
package>
                <
theme>
                    <default>default</default>
<!-- 
I added the following line to specify my own theme -->
                    <
default_clean>my_own_theme</default_clean>
                </
theme>
            </
design>
        </
admin>
    </
stores>

now, adminhtml uses app/design/adminhtml/default/my_own_theme/.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Romain_C
Member
 
Avatar
Total Posts:  74
Joined:  2008-07-25
Hossegor, France
 

Does this work as well for specifying the adminhtml skin ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
emislive
Jr. Member
 
Total Posts:  3
Joined:  2009-04-03
 

You can specify the adminhtml package/theme in any module’s config.xml (hint, hint: use your own and don’t modify the core files):

<stores>
    <
admin>
    <!-- default 
admin design package and theme -->
        <
design>
            <
package>
                <
name>package</name>
            </
package>
            <
theme>
                <default>
theme</default>
            </
theme>
        </
design>
    </
admin>
</
stores>

Or you can set it programmatically by registering an event observer on the controller_action_predispatch or controller_action_predispatch_start events. Just be sure you don’t hide the default behavior: controller_action_predispatch is used to process logins, and observers of controller_action_predispatch_start sets the store to be the default ‘admin’ store among other things. Advantages of this approach: you can have an Observer in a local module, no changes to the core, and if you observe controller_action_predispatch, extend Mage_Admin_Observer and call parent::actionPreDispatchAdmin() to handle login/authentication you can then get the current admin user and set a user specific theme…

This can also be done in the DB. First, the package/theme (the <stores> .... </stores> section) needs to be removed from all config.xml files. The following SQL will add the config values to use package/theme:

INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`)
VALUES (NULL'default''0''stores/admin/design/package/name''package');

INSERT INTO `core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`)
VALUES (NULL'default''0''stores/admin/design/theme/default''theme');
If you don’t understand how to do this, DON’T!!! If you aren’t comfortable working with a DB directly, DON’T DO THIS!!! If you ignore these warnings and mess up your production site, you’re on your own. Since the DB method still requires changing Mage/Adminhtml/etc/config.xml it is less than ideal.

So yeah, generally the XML config overrides the DB config, I think. I haven’t verified that this works in all cases.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mfoillard
Member
 
Total Posts:  67
Joined:  2008-08-04
 

Using 1.4.x (i presume), It seems we have to declare override for each theme component like this :

<stores>
    <
admin>
      <
design>
        <
package>
          <
name>default</name>
        </
package>
        <
theme>
          <default>
mytheme</default>
          <
template>mytheme</template>
          <
skin>mytheme</skin>
          <
layout>mytheme</layout>
          <
locale>mytheme</locale>
        </
theme>
      </
design>
    </
admin>
  </
stores>

See : app/code/core/Mage/Adminhtml/Controller/Action.php +143
It works here now

 
Magento Community Magento Community
Magento Community
Magento Community
 
reivilo
Jr. Member
 
Total Posts:  4
Joined:  2010-09-15
 

Dear all,

In the Magento 1.4.1.1 Admin Panel I want to change the logos and footer text:

1) css and logo files originally located in /skin/adminhtml/default/default :
- boxes.css
- favicon.ico (the little icon in the URL bar)
- images/login_logo.gif (the logo on its side at the left of the login screen)
- images/logo.gif (the top left logo in admin panel after login in)

2) the text of the following files originally located in /app/design/adminhtml/default/default/template :
- login.phtml
- page/footer.phtml

I followed all instructions in above posts but even after *several* hours of searching and testing nothing changes, so I hope you can help me out?!

An overview of all the changes I did:

a) Copied and changed files in 1) to /skin/adminhtml/mycompany/default
b) Copied and changed files in 2) to /app/design/adminhtml/mycompany/default/template
c) Copied /app/code/core/Mage/Adminhtml/etc/config.xml to /app/code/local/mycompany/Adminhtml/etc/config.xml and changed/added as follows, while leaving all the rest unchanged:

<config>
    <
modules>
       <
mycompany_Adminhtml>
            <
version>0.1.0</version>
        </
mycompany_Adminhtml>
    </
modules>

<
stores>
        <
admin>
            <
design>
                <
package>
                    <
name>mycompany</name>
                </
package>
                <
theme>
                    <default>default</default>
                    <
template>default</template>
                    <
skin>default</skin>
                    <
layout>default</layout>
                    <
locale>default</locale>
                </
theme>
            </
design>
        </
admin>
 </
stores>

d) Created /app/etc/modules/mycompany_All.xml with

<config>
    <
modules>
        <
mycompany_Adminhtml>
            <
active>true</active>
            <
codePool>local</codePool>
        </
mycompany_Adminhtml>
    </
modules>
</
config>

What am I doing wrong or forgetting? All help much appreciated!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
webplus
Member
 
Avatar
Total Posts:  46
Joined:  2008-11-06
 

a) Copied and changed files in 1) to /skin/adminhtml/mycompany/default
b) Copied and changed files in 2) to /app/design/adminhtml/mycompany/default/template
c) Copied /app/code/core/Mage/Adminhtml/etc/config.xml to /app/code/local/mycompany/Adminhtml/etc/config.xml and

wrong directories first of all

should be

/skin/adminhtml/default/mycompany/
/app/design/adminhtml/default/mycompany/template

here is my admin theme

hope this helps

Image Attachments
admin.GIF
 
Magento Community Magento Community
Magento Community
Magento Community
 
reivilo
Jr. Member
 
Total Posts:  4
Joined:  2010-09-15
 

@webplus: thanks for fast reply, but my problem still not solved!

with my a) en b) directories I tried to create a new package in adminhtml and not only a theme.
is creating a separate package not possible for adminhtml? (as it for front end!)

i also tried with your suggested directory structure while also changing /app/code/local/mycompany/Adminhtml/etc/config.xml as follows since as far as I understand this means only changing theme and not complete package

<stores>
        <
admin>
            <!-- default 
admin design package and theme -->
            <
design>
                <
package>
                    <
name>default</name> <!-- instead of mycompany before -->
                </
package>
                <
theme>
                    <default>
mycompany</default> <!-- instead of default before -->
                </
theme>
            </
design>
        </
admin>
    </
stores>

Are you also using 1.4.1.1 ?

Thanks for all support!

 
Magento Community Magento Community
Magento Community
Magento Community
 
reivilo
Jr. Member
 
Total Posts:  4
Joined:  2010-09-15
 

I forgot to post that my problem is solved: Make sure your module’s first letter is capitlized; “mycompany” apparently did not work, it must start with a capital letter “Mycompany”!

I got both the package (in /app/design/adminhtml/mycompany/default) and theme (in /app/design/adminhtml/default/mycompany) approach working,
I decided to go for the latter since with the seperate package approach I ended up in copying everything from /app/design/adminhtml/default/default, since there is no design fall-back hierarchy as in front-end.
Although using 1.4.1.1. it seemed i didn’t need the change mfoillard was suggesting to get it working.

Still curious though:
- what could be the considerations to create a complete seperate adminhtml package?
- is the seperate theme approach in default package as upgrade proof as using a separate package, or better?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonathan.dh
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2010-06-02
 

Emislive’s solution also works in your main local.xml file (not the design one, but the config one) : /app/etc/local.xml

Tested on Magento 1.4.1.1

<config>

  ...

  <
stores>
      <
admin>
          <!-- default 
admin design package and theme -->
          <
design>
              <
package>
                  <
name>default</name> <!-- instead of mycompany before -->
              </
package>
              <
theme>
                  <default>
theme</default> <!-- instead of default before -->
              </
theme>
          </
design>
      </
admin>
  </
stores>
</
config>

------------------------------------------------------------
Doghouse Media - Perth based web agency

 
Magento Community Magento Community
Magento Community
Magento Community
 
Spot the Cat
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2010-03-18
 

Worked purrrfectly in 1.4.2. Thanks bro.

<config>

  ...

  <
stores>
      <
admin>
          <!-- default 
admin design package and theme -->
          <
design>
              <
package>
                  <
name>default</name> <!-- instead of mycompany before -->
              </
package>
              <
theme>
                  <default>
theme</default> <!-- instead of default before -->
              </
theme>
          </
design>
      </
admin>
  </
stores>
</
config>

 
Magento Community Magento Community
Magento Community
Magento Community
 
ayooba
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2011-06-22
Spain
 

We have just launched an Admin Theme extension. The Cool Blue Admin Theme is compatible with Magento versions 1.5.0.1 and greater. It’s very easy to install and does not overwrite any core files, so you can upgrade without the theme been affected.
• Compatible with versions 1.5.0.1+ , 1.6+, 1.7
• Licence is per domain. If you have multiple sub domains we treat that as one domain so you only need one licence
• Full Admin theme
• Full admin features
• No core file overwritten
• Stable (tested for one year)
• Looks amazing
• Full installation and setup instructions included in the download
• Installation service available

http://ayooba.com/cool-blue-admin-theme.html

Image Attachments
admin_icon.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
haligonia
Sr. Member
 
Total Posts:  97
Joined:  2009-02-28
 

I had to read this thread about 10 times to get this working so, for the sake of clarifying for others, I’m just posting the explanation of how to create your own module to add your custom adminhtml templates.

This method definitely works. I got it working in 1.7.0.1. It assumes that you will change MyCompany to something more suitable.

First, create a file called app/etc/modules/MyCompany_All.xml and put this code in it:

<?xml version="1.0"?>
<!--
/**
 * My Custom Adminhtml Module
 */
-->

<
config>
    <
modules>
        <
MyCompany_Adminhtml>
            <
active>true</active>
            <
codePool>local</codePool>
        </
MyCompany_Adminhtml>
    </
modules>
</
config>

Then create a file called app/code/local/MyCompany/Adminhtml/etc/config.xml and add this code:

<?xml version="1.0"?>
<!--
/**
 * My Custom Adminhtml Config
 */
-->

<
config>
    <
modules>
       <
MyCompany_Adminhtml>
            <
version>0.1.0</version>
        </
MyCompany_Adminhtml>
    </
modules>
    
    <
stores>
        <
admin>
            <
design>
                <
package>
                    <
name>default</name>
                </
package>
                <
theme>
                    <default>
MyCompany</default>
                </
theme>
            </
design>
        </
admin>
    </
stores>
</
config>

Third, modify / edit / create the template files you want and put them in the correct directory (corresponding to the Mage default location) under app/design/adminhtml/default/MyCompany/template/…

where you fill in “...” with the necessary directory structure to get the files in the right location.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 2