Helper Block Definition
Posted About 11 years ago. Visible to the public.
<config>
<global>
<helpers>
<namespace_module>
<class>Namespace_Module_Helper</class>
</namespace_module>
</helpers>
</global>
</config>
Last edit
Over 10 years ago
Related cards:
Config Block Definition
<config>
<global>
<blocks>
<namespace_module>
<class>Namespace_Module_Block</class>
</namespace_module>
</blocks>
</global>
</config>
![](http://m...
Config Block rewrite Definition
<config>
<global>
<blocks>
<catalog>
<rewrite>
<product>Namespace_Module_Block_Catalog_Product</product>
</rewrite>
</catalog>
...
Config Helper Rewrite Definition
<config>
<global>
<helpers>
<catalog>
<rewrite>
<data>Namespace_Module_Helper_Catalog_Data</data>
</rewrite>
</catalog>
...
Messages and Global Messages Blocks
Both use the same block, as we can see in page.xml
:
<block type="core/messages" name="global_messages" as="global_messages"/>
<block type="core/messages" name="messages" as="messages"/>
When you add a message, you add it to the session...
Children of Anonymous Blocks are Orphaned
What a sad state of affairs. If a childs parent has no name, the child block becomes orphaned and alone, somewhere lost in Layout XML hell. To sort it, give the parent a name. The reason? The layout XML parser uses the name of the parent in XML to...
Block Caching
To cache a block individually, add this method to the blocks class:
protected function _construct()
{
$this->addData(array(
'cache_lifetime' => 3600,
'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TA...
Config FPC Placeholder Definition
This should go in cache.xml
. See Boilerplate FPC No-Cache Container for a boilerplate container.
<config>
<placeholders>
<namespace_module>
...
Boilerplate Block Class
With template support:
/**
* Yourcompany.com
*
* PHP Version 5
*
* @category Namespace
* @package Namespace_Module
* @author Your Name <your.name@yourcompany.com>
* @copyright 2012 yourcompany.com...
Boilerplate Helper Class
/**
* Yourcompany.com
*
* PHP Version 5
*
* @category Namespace
* @package Namespace_Module
* @author Your Name <your.name@yourcompany.com>
* @copyright 2012 yourcompany.com
* @license http:...
Config ACL Definition
This should go in adminhtml.xml
. Also see Config Menu Definition (note that the XML path of the menu entry needs to match up with the XML path of the ACL entry). To see how to impl...
Posted by Mike Whitby to Magento (2013-05-16 15:41)