protected function _construct() { if (!self::$_helper) { self::$_helper = Mage::helper('blog'); } if (!self::$_collection) { self::$_collection = $this->_prepareCollection(); } }
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); }
public function _prepareLayout() { $route = Mage::helper('blog')->getRoute(); $isGalleryPage = Mage::app()->getFrontController()->getAction()->getRequest()->getModuleName() == 'blog'; $breadcrumbs = $this->getLayout()->getBlock('blog.archive.breadcrumbs'); ############# Adding Breadcrumbs -- Source http://www.magestore.com/blog/2010/04/17/add-custom-breadcrumbs-to-any-pages ############## if ($isGalleryPage && $breadcrumbs) { $breadcrumbs->addCrumb('home', array('label' => Mage::helper('blog')->__('Home'), 'title' => Mage::helper('blog')->__('Home'), 'link' => $this->getUrl(Mage::helper('blog')->getRoute()))); $breadcrumbs->addCrumb('blogarc', array('label' => Mage::helper('blog')->__('Archive'), 'title' => Mage::helper('blog')->__('Archive'), 'link' => Mage::getUrl("blog/archive"))); $breadcrumbs->addCrumb('arctitle', array('label' => $this->getArchiveMonthYear(), 'title' => $this->getArchiveMonthYear())); } return parent::_prepareLayout(); }
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())); } } }
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() == AW_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(); } }
protected function _construct() { if (!self::$_helper) { self::$_helper = Mage::helper('blog'); } }
protected function _prepareHead() { parent::_prepareMetaData($this->getPost()); return $this; }
public function getPostsCustom($key) { $collection = Mage::getModel('blog/blog')->getCollection()->addPresentFilter()->addStoreFilter(Mage::app()->getStore()->getId(), false)->setOrder('created_time ', 'desc'); Mage::getSingleton('blog/status')->addEnabledFilterToCollection($collection); $collection->addContentFilter($key); $post_tobe_displayed = (int) Mage::getStoreConfig(AW_Blog_Helper_Config::XML_BLOG_PERPAGE); $collection->setPageSize($post_tobe_displayed); $currentPage = (int) $this->getRequest()->getParam('page'); if (!$currentPage) { $currentPage = 1; } $collection->setCurPage($currentPage); parent::_processCollection($collection); return $collection; }
protected function _toHtml() { return Mage::helper('blog')->filterWYS(parent::_toHtml()); }
public function _construct() { parent::_construct(); return $this->setTemplate('aw_blog/menu.phtml'); }
public function _toHtml() { if (Mage::helper('blog')->getEnabled()) { $isLeft = $this->getParentBlock() === $this->getLayout()->getBlock('left'); $isRight = $this->getParentBlock() === $this->getLayout()->getBlock('right'); $isBlogPage = Mage::app()->getFrontController()->getAction()->getRequest()->getModuleName() == 'blog'; $leftAllowed = $isBlogPage && Mage::getStoreConfig('blog/menu/left') == 2 || Mage::getStoreConfig('blog/menu/left') == 1; $rightAllowed = $isBlogPage && Mage::getStoreConfig('blog/menu/right') == 2 || Mage::getStoreConfig('blog/menu/right') == 1; if (!$leftAllowed && $isLeft) { return ''; } if (!$rightAllowed && $isRight) { return ''; } try { if (Mage::getModel('widget/template_filter')) { $processor = Mage::getModel('widget/template_filter'); } return $processor->filter(parent::_toHtml()); } catch (Exception $ex) { return parent::_toHtml(); } } }