Friday 30 September 2011

Magento

1. In the content field of HOME PAGE(CMS), I wrote this code: 
{{block type='blog/blog' name='home.blog.recentposts' alias=recent_posts' template='aw_blog/recent_posts.phtml }}
2. In the path of templates(app/design/frontend/default/THEME/aw_blog), I created the file recent_posts.phtml 
<?php $posts $this->getPosts(); ?><h4><?php print Mage::helper('blog')->__('Blog'); ?></h4>
<
ul id="post-blog"><?php foreach ($posts as $post):$data explode(' ',$post->getCreatedTime());?>
    
<li><span class="data"><?php print substr($data[0],0,5?> | <a href="<?php echo $post->getAddress(); ?>"><?php print $post->getTitle(); ?></a></li><?php endforeach; ?> </ul>

No comments:

Post a Comment