magento layout xml 小结

基础概念: http://magebase.com/magento-tutorials/demystifying-magentos-layout-xml-part-1/

调试方案函数:

$this->getLayout()->getNode()->asXML();
Mage::app()->getLayout()->getUpdate()->getHandles();

 在 layout里面传参数

 <block type="aosom_searchlandingpage/product_list" name='seo_button_content'  template="aosom_seo/product.phtml"  >
         <action method="setData">
                 <name>id</name>
                 <value>2609,2608,2607,2606,2605,2604</value>
         </action>
   </block>

action 的一些method:http://www.demacmedia.com/magento-commerce/magento-layout-xml-action-method-reference/

在phtml里面 只需

$this->getData('id')

在cms的content里调用phtml

{{block type="core/template"   template="aosom_seo/keywords.phtml"  id="1"}}

参数可直接写在后面  取的时候 直接$this->getId()



原文地址:https://www.cnblogs.com/cangzhou/p/5673982.html