Custom Admin Theme in Magento

E-mail Print PDF

You can setup a new admin theme, very similar to the way you do it for a frontend theme (add new folders/files in the package and theme locations in app/design/adminhtml and skin/adminhtml). Once that is in place, just override app/code/core/Mage/Adminhtml/etc/config.xml as app/code/local/Myname/Adminhtml/etc/config.xml and add the following code to it:

 

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

Also note you will need to enable your new module before the changes are recognized.

Custom Modules

Most likely you will want to make a module that represent’s your company to hold all your specific changes. Start off by making a new directory like so:

app/
code/
core/
community/
local/
XyzCorp/

Now, if you need to make changes to the Magento file, Mage/Catalog/Block/Breadcrumbs.php, you can add a new directory for the “Catalog” module under your XyzCorp directory, then a blocks directory and copy the file into this new directory. Also you need to create config.xml of your module.

app/
code/
core/
community/
local/
XyzCorp/
Catalog/
Block/
Breadcrumbs.php
etc/
config.xml

Change the class name inside the file by starting off with “XyzCorp” instead of “Mage”.

Strip out all the code you don’t need, and make it subclass the original class name (”Mage_Catalog_Block_Breadcrumbs”).

Now, you must activate your module so Magento theme understands that there is new code in the “local” directory.

In app/etc/modules/XyzCorp_Catalog.xml, add the following lines

<?xml version="1.0"?>
<config>
<modules>
<XyzCorp_Catalog>
<active>true</active>
<codePool>local</codePool>
</XyzCorp_Catalog>
</modules>
</config>

It is crucial that the same prefix XyzCorp is used throughout files, class names, directories, and XML tag names.

Now, your own catalog module is activated, but when will it actually be called by the system? Ahh, we need a special rewrite tag to instruct Magento to use this one file (Breadcrumbs.php) instead of its default.

Now we should rewrite block using your module’s config file.

 

Testimonials

Jeg er en webdesigner. Du sparer meg mye tid, og jeg elsker design. Jeg har kjøpt over 10.

--- ANDREAS

Esta é a maior experiência de criação de site que já tive. Os modelos são grandes e os de apoio ao cliente é maior.

--- Uiara

Mallarna är så mycket kreativitet, färg, ljud, animation alla sätta togheter det är fantastiskt.

--- GÖSTA

Soy un diseñador de páginas web de España. Estoy muy inspirado en sus diseños. Especial agradecimiento a los diseños impresionantes. Es realmente buena.

--- AURELIANO

Ήθελα απλώς να σας ενημερώσουμε ότι η εξυπηρέτηση των πελατών σας με βοήθησε με ένα πρότυπο που έχω πρόσφατα αγοράσει. Όντας ένα newbie να αναβοσβήνουν έδωσε μερικές οδηγίες που θα αποδειχθεί χρήσιμη.

--- Ακακαλλις

 
You are here: Tips and Tricks Custom Admin Theme in Magento