Example #1
0
 protected function _prepareLayout()
 {
     $post = $this->getCategory();
     $breadcrumbs = $this->getCrumbs();
     if ($breadcrumbs) {
         $breadcrumbs->addCrumb('blog', array('label' => self::$_helper->getTitle(), 'title' => $this->__('Return to %s', self::$_helper->getTitle()), 'link' => $this->getBlogUrl()));
         $breadcrumbs->addCrumb('blog_page', array('label' => $post->getTitle(), 'title' => $post->getTitle()));
     }
     parent::_prepareMetaData($post);
 }
Example #2
0
 public function getBlogArrForColumns()
 {
     $route = Mage::getStoreConfig('blog/blog/route');
     if ($route == "") {
         $route = "blog";
     }
     $route = Mage::getUrl($route);
     $blogDataArr = array();
     $index = 0;
     $record = 0;
     $column = '';
     $contentFormat = Mage::getStoreConfig('blog/blog/contentformat');
     if ($contentFormat == 'blog_1_column') {
         $maxIndex = 1;
     } elseif ($contentFormat == 'blog_2_column') {
         $maxIndex = 2;
     } else {
         $maxIndex = 3;
     }
     $blogObj = new AW_Blog_Block_Blog();
     $blogCollec = $blogObj->getPosts();
     foreach ($blogCollec as $blog) {
         $column = $record % $maxIndex;
         $cats = Mage::getModel('blog/cat')->getCollection()->addPostFilter($blog->getId())->addStoreFilter(Mage::app()->getStore()->getId(), false);
         foreach ($cats as $cat) {
             $catUrl = $route . "cat/" . $cat->getIdentifier();
             break;
             //Force break after first category
         }
         if (Mage::getStoreConfig('blog/blog/categories_urls')) {
             $postUrl = $catUrl . '/post/' . $blog->getIdentifier();
         } else {
             $postUrl = $route . $blog->getIdentifier();
         }
         $blogDataArr[$column][$index]['category'] = $this->getBlogCats($blog->getId());
         $blogDataArr[$column][$index]['title'] = $blog->getTitle();
         $blogDataArr[$column][$index]['date'] = $blog->getCreatedTime();
         $blogDataArr[$column][$index]['short_desc'] = $blog->getPostContent();
         $blogDataArr[$column][$index]['contnt_img'] = $this->getBlogLandingImgs($blog);
         $blogDataArr[$column][$index]['more_link'] = $postUrl;
         $blogDataArr[$column][$index]['comments'] = $blog->getCommentCount();
         $index++;
         $record++;
     }
     //pr($blogDataArr);
     return $blogDataArr;
 }