我在这件事上有点不知所措。我正在使用AheadWorks博客扩展将当前日历年的事件帖子添加到我的页面。该扩展还创建了这些帖子的提要,我正在将其馈送到GoogleCalendar。正因为如此,我使用事件的日期作为创建的日期,因此它们可以正确地输入到Google日历中。然而,我不知道如何让Magento显示所有帖子;它只显示创建日期为当天或更早的日期。我理解这是默认设置;我怎样才能绕过它,让所有的帖子都显示出来,而不管created_time如何?
我看到了一些关于更改存储时间的建议,其中一些建议提到编辑created.php文件,但我真的不确定从何开始?
有人能告诉我需要做什么吗?
这里是app/code/community/AW/Blog/Block/Blog.php:
<?php
class AW_Blog_Block_Blog extends AW_Blog_Block_Abstract
{
public function getPosts()
{
$collection = parent::_prepareCollection();
$tag = $this->getRequest()->getParam('tag');
if ($tag) {
$collection->addTagFilter(urldecode($tag));
}
parent::_processCollection($collection);
return $collection;
}
protected function _prepareLayout()
{
if ($this->isBlogPage() && ($breadcrumbs = $this->getCrumbs())) {
parent::_prepareMetaData(self::$_helper);
$tag = $this->getRequest()->getParam('tag', false);
if ($tag) {
$tag = urldecode($tag);
$breadcrumbs->addCrumb(
'blog',
array(
'label' => self::$_helper->getTitle(),
'title' => $this->__('Return to ' . self::$_helper- >getTitle()),
'link' => $this->getBlogUrl(),
)
);
$breadcrumbs->addCrumb(
'blog_tag',
array(
'label' => $this->__('Tagged with "%s"', self::$_helper->convertSlashes($tag)),
'title' => $this->__('Tagged with "%s"', $tag),
)
);
} else {
$breadcrumbs->addCrumb('blog', array('label' => self::$_helper->getTitle()));
}
}
}
}
这里是app/design/frontend/[主题]/[主题]/template/aw_blog/blog.phtml:
<?php
?><?php $posts = $this->getPosts(); ?>
<div id="messages_product_view">
<?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?>
<?php echo Mage::app()->getLayout()->getMessagesBlock()->getGroupedHtml(); ?>
</div>
<?php echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>
<?php foreach ($posts as $post): ?>
<div class="postWrapper">
<div class="postTitle">
<h2><a href="<?php echo $post->getAddress(); ?>" ><?php echo $post->getTitle(); ?></a></h2>
<h3><?php echo $post->getCreatedTime(); ?></h3>
</div>
<div class="postContent">
<?php echo $post->getPostContent(); ?>
</div>
<?php echo $this->getBookmarkHtml($post) ?>
<div class="tags"><?php echo $this->getTagsHtml($post) ?></div>
<div class="postDetails">
<?php if ($this->getCommentsEnabled()): ?>
<?php echo $post->getCommentCount(); ?> <a href="<?php echo $post->getAddress(); ?>#commentBox" > <?php echo Mage::helper('blog')->__('Comments'); ?></a> |
<?php endif; ?>
<?php $postCats = $post->getCats(); ?>
<?php if (!empty($postCats)): ?>
<?php echo Mage::helper('blog')->__('Posted in'); ?>
<?php foreach ($postCats as $data): ?>
<a href="<?php echo $data['url']; ?>"><?php echo $data['title']; ?></a>
<?php endforeach; ?>
<?php else: ?>
<?php echo Mage::helper('blog')->__('Posted'); ?>
<?php endif; ?><?php echo $this->__("By"); ?> <?php echo $post->getUser(); ?></div>
</div>
<?php endforeach; ?>
<?php echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>