Magento Certified Developer GuideCategory: 3.1 Design & LayoutHow are >update<, >block<, and >action< used in Magento layout?
Manish Prakash Staff asked 6 years ago

update directive in layout xml is used to add handle to the current action

<update handle="catalog_seo_sitemap" />

This directive is processed from “load()” function in “core/layout_update” class then “fetchPackageLayoutUpdates()” and then “fetchRecursiveUpdates()” which finally reads the “update” directive.

block directive is used to add child blocks

<block type='core/template' name='test' template='page/html/test.phtml'/>

This is processed in “generateBlocks()” in “core/layout” class

action directive is used to call a function which is defined in the block class using layout xml

<block type="catalog/seo_sitemap_category" name="seo.sitemap.sitemap" as="sitemap" after="pager_top" template="catalog/seo/sitemap.phtml">
                <action method="bindPager"><pager></pager></action>
                <action method="bindPager"><pager>seo.sitemap.pager.bottom</pager></action>
                <action method="setItemsTitle" translate="title" module="catalog"><title>categories</title></action>

This is processed in “generateBlocks()” in “core/layout” class