Magento: Create CMS Page & Static Block programmatically

You can manually create CMS Pages in Magento from CMS -> Pages. Similarly, you can create Static Blocks from CMS -> Static Blocks. This article will show how to create CMS pages and Static blocks programmatically from code. Create CMS Page Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $cmsPage = array( 'title' => 'Test Page', 'identifier' => 'test-page', 'content' => 'Sample Test Page', 'is_active' => 1, 'sort_order' => 0, 'stores' => array(0), 'root_template' => 'three_columns' ); Mage::getModel('cms/page')->setData($cmsPage)->save();
查看更多 →

重新排布Magento Block的位置

这个需求太现实了。Magento是很灵活,好多的功能分割成一个个区块(block,其它的框架中也有类似概念,如seagull php框架,但是
查看更多 →