magento:动态生成cms页面

magento:动态生成cms页面,magento,content-management-system,Magento,Content Management System,大家好, 我需要知道是否可以动态创建CMS页面,对应于在Magento中创建的每个新产品。或者简单地在magento中动态创建CMS页面 我对它做了很多研究,但找不到确切的内容。(我正在使用Magento 1.5。) 请帮忙,有没有可能?若否,原因为何?我需要至少知道为什么不可能在Magento中动态创建CMS页面 任何帮助都将不胜感激。 非常感谢以下是以动态/编程方式创建CMS页面的代码:- Mage::app()->setCurrentStore(Mage_Core_Model_App

大家好,

我需要知道是否可以动态创建CMS页面,对应于在Magento中创建的每个新产品。或者简单地在magento中动态创建CMS页面

我对它做了很多研究,但找不到确切的内容。(我正在使用Magento 1.5。)

请帮忙,有没有可能?若否,原因为何?我需要至少知道为什么不可能在Magento中动态创建CMS页面

任何帮助都将不胜感激。
非常感谢

以下是以动态/编程方式创建CMS页面的代码:-

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$cmsPage = array(
            'title' => 'My CMS Page',
            'identifier' => 'cms-page',
            'content' => 'Sample CMS Page',             
            'is_active' => 1,
            'sort_order' => 0,
            'stores' => array(0),
            'root_template' => 'three_columns'
            );

Mage::getModel('cms/page')->setData($cmsPage)->save();

注意行:
Mage::app()->setCurrentStore(Mage\u Core\u Model\u app::ADMIN\u STORE\u ID)仅是必要的。

不客气!如果成功了,别忘了接受并投票支持答案;)