Magento Block Names and Aliases

Magento allows you to add names and aliases to your blocks when adding a block within layout XML configuration. This is done by defining a block with name and as attributes.
<block type=”core/template” name=”module.custom.block” as=”custom_block” template=”custom/template.phtml” />
Often it is unclear what the purpose of these attributes are used for.
When defining a block, the …

Removing XML Blocks in Magento

This article will help you go about removing XML blocks in Magento.
Magento’s default theme comes with default layout blocks included such as a PayPal logo, a community poll and other unnecessary inclusions.

More than likely, you will want to remove these blocks when building your own custom theme.
There are two main …

Magento Render Layout

The main responsibilities of the Magento render layout method is to get the layout output, process this output and append the output to the body of the response. Let’s take a look at the method within the Mage_Core_Controller_Varien_Action class.
The first line of interest is the _renderTitles() method which sets the page title that can …

Magento Load Layout

Magento layout files are located within the app/design/frontend/[your_package]/[your_theme]/layout directory. Template files are defined within these files within layout handles that Magento loads depending on what specific page you’re viewing on the website. How does Magento do this? For this, we’ll need to take a look at the Magento load layout and render layout methods located …

Magento Top Links XML

At the top of a Magento website, there are top links. These top links are not defined within template files but through Magento’s layout configuration.
The RWD theme’s top links are found by clicking the Account link in the header of the website.

The top links are not all defined within one layout …

Magento Structural and Content Blocks

Within Magento’s layout files, there are structural and content blocks that are defined. This article will cover the differences between the two.
Structural blocks are, as the name suggests, blocks that define the structure of the page. Examples of structural blocks are: header, left, content, right and footer.
The content structural block is defined …

Magento Adding Custom CSS and JS

It is common practice when creating a custom theme in Magento to add an additional stylesheet or JavaScript file that contains custom functionality.
Whilst it is not common practice to edit Magento’s existing layout files to achieve this, you can add layout updates to the theme’s local.xml layout file. This file might not exist …