Posts

Magento Custom Source Model

Magento uses source models as a means of gathering data from either the database or from files, and displaying the data against a specific field. We can also add a Magento custom source model using a custom module. Examples of existing source models in Magento include the following.

catalog/product_status – used for the Status ...

Magento ACL Permissions

Magento ACL Permissions are used with the admin area and check to see whether a user has permission to access a particular area.
Within the preDispatch() method of the Mage_Adminhtml_Controller_Action class, a call to the _isAllowed() method is made.
The isAllowed() method is usually overridden in module’s individual controller file, such as the ProductController.php file.

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 Create Block

This article will look at how Magento generates and creates its blocks from reading the layout configuration within its layout files.
If you haven’t already seen how Magento gets its layout config, it is recommended to read the Magento Load Layout article.
The generateBlocks() method is a good starting place to look at within the ...

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 ...

Magento Solution Specialist Sample Questions

When studying for the Magento Solution Specialist exam, a lot of questions are focused on areas such as PCI compliance, and the inner workings of the Magento admin area. Some questions you should be asking yourself prior to taking the exam can be seen below.
What is PCI and PA-DSS Compliance?
PCI Compliance – ...

Magento Rewrite Blocks, Helpers, Models and Controllers

As well as Magento giving us the ability to add custom blocks, helpers, models and controllers, we also have the ability to safely rewrite these existing classes without affecting the Magento upgrade process or security patches that may overwrite some of these files.
If you haven’t already read the article about adding custom blocks, ...