Saturday, April 14, 2012

Magento base system principle


Block updates is set in config.xml
config > layout > updates > [modulename] > file
#files tag will point to a layout xml file in app/design/frontend/[themename]/layout/[modulename].xml

in [modulename].xml contains:
layout > [modulename] > [controllername] > [actionname] > reference [name=content] > block

block attributes available are:
type: To base this block on a class in your module. naming is case sensitive
@format: [Modulename]/[Block name]
@example: type="ProductLister/Lister" points to app/code/local/[namespace]/[Modulename]/Block/[Block name].php, with class name: [namespace]_[Modulename]_Block_[Block name]
name: a name which can be retrieved by calling $this->getChild('name') or $controller->getLayout()->getBlock("name")
template: points to the actual path of the phtml template file
@location: app/design/frontend/[themename]/template/[path]

No comments: