Create your own Backend theme

When developing Magento Backend functionalities, sometimes you need to add own layout files or templates. In these cases it is a good idea to create a new Backend theme under adminhtml and to modify the Magento configuration to lookup layout files and templates in this new theme before searching in the default one. Therefore you have to create […]

Trigger layout handle in another layout handle

In most cases you don’t want to write the same layout declaration twice. With the following snippet you can trigger a once written layout handle in other layout handles. So you can reuse the declaration.

Add JavaScript or CSS in Block class

 To add JavaScript or CSS files to the head section of the resulting HTML page, you can add something like this to the _prepareLayout function of a Block class:

As you can see, we can use the layout model to get the head block an use its functions to add files. This doesn’t work inside of […]

Add static block to cms page

First, you can use the XML-Layout-Update of the respective page (or other layout updates in every layout xml file ):

Or you can use the following placeholder:

Add link to header navigation

The following code inserts a link for extended search into the headers top link navigation

It is really important, that all sub elements of  the action tag are in the exact this order as the corresponding parameters of the underlaying method Mage_Page_Block_Template_Links:: addlink. If storecodes are used, you have to set the prepare node to […]