Exemplo n.º 1
0
 protected function _construct()
 {
     if (!self::$_helper) {
         self::$_helper = Mage::helper('blog');
     }
     if (!self::$_collection) {
         self::$_collection = $this->_prepareCollection();
     }
 }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
 public function getPosts()
 {
     $collection = parent::_prepareCollection();
     $tag = $this->getRequest()->getParam('tag');
     if ($tag) {
         $collection->addTagFilter(urldecode($tag));
     }
     parent::_processCollection($collection);
     return $collection;
 }
Exemplo n.º 4
0
 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()));
         }
     }
 }
Exemplo n.º 5
0
 protected function _toHtml()
 {
     if (self::$_helper->getEnabled()) {
         $parent = $this->getParentBlock();
         if (!$parent) {
             return null;
         }
         $showLeft = Mage::getStoreConfig('blog/menu/left');
         $showRight = Mage::getStoreConfig('blog/menu/right');
         $isBlogPage = Mage::app()->getRequest()->getModuleName() == ShopShark_Blog_Helper_Data::DEFAULT_ROOT;
         $leftAllowed = $isBlogPage && $showLeft == 2 || $showLeft == 1;
         $rightAllowed = $isBlogPage && $showRight == 2 || $showRight == 1;
         if (!$leftAllowed && $parent->getNameInLayout() == 'left') {
             return null;
         }
         if (!$rightAllowed && $parent->getNameInLayout() == 'right') {
             return null;
         }
         return parent::_toHtml();
     }
 }
Exemplo n.º 6
0
 protected function _prepareHead()
 {
     parent::_prepareMetaData($this->getPost());
     return $this;
 }