Magento - 显示CMS页面的创建日期/时间

时间:2012-01-10 23:48:59

标签: magento

我通过复制(和重命名)2columns-left.phtml并设置适当的xml配置选项等来创建自定义CMS布局。

我想在内容下方显示CMS创建时间(creation_time字段)。我该怎么做?

或者,在CMS布局页面中,如何访问基础CMS页面数据?

1 个答案:

答案 0 :(得分:1)

<?php
   $collection = Mage::getModel('cms/page')->getCollection();  

   foreach($collection as $page) {
      print_r($page->debug());
   }
?>

[Array]  
(  
    [page_id] => 2  
    [title] => Home Page  
    [root_template] => three_columns  
    [meta_keywords] =>  
    [meta_description] =>  
    [identifier] => home  
    [content] => Hello...  
    [creation_time] => 2012-01-11 21:15:34  
    [update_time] => 2012-01-11 21:18:16  
    [is_active] => 1  
    [sort_order] => 0  
    [layout_update_xml] =>  
    [custom_theme] =>  
)  

这是阵列,其余部分由你决定...