Ejemplo n.º 1
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $page = $this->getPage();
     if ($head = $this->getLayout()->getBlock('head')) {
         $head->setRobots($page->getMetaRobots());
     }
 }
Ejemplo n.º 2
0
 /**
  * Prepare global layout
  *
  * @return Mage_Cms_Block_Page
  */
 protected function _prepareLayout()
 {
     $head = $this->getLayout()->getBlock('head');
     if ($head) {
         if (Mage::helper('catalog/product')->canUseCanonicalTag()) {
             $current_url = preg_replace("/(.*\\.com\\/)(?:.*\\/)(.*\\/)+/i", "\$1\$2", $this->helper('core/url')->getCurrentUrl());
             $head->addLinkRel('canonical', $current_url);
         }
     }
     return parent::_prepareLayout();
 }
Ejemplo n.º 3
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     /** @var Mage_Page_Block_Html_Head $head */
     $head = $this->getLayout()->getBlock('head');
     if ($head) {
         $page = $this->getPage();
         $option = Mage::getSingleton('metarobots/attribute_source_metarobots');
         $head->setRobots($option->getOptionLabel($page->getMetaRobots()));
     }
 }
Ejemplo n.º 4
0
 protected function _prepareLayout()
 {
     $page = $this->getPage();
     // show breadcrumbs
     if (Mage::getStoreConfig('web/default/show_cms_breadcrumbs') && ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) && $page->getIdentifier() !== Mage::getStoreConfig('web/default/cms_home_page') && $page->getIdentifier() !== Mage::getStoreConfig('web/default/cms_no_route')) {
         $breadcrumbs->addCrumb('home', array('label' => Mage::helper('cms')->__('Home'), 'title' => Mage::helper('cms')->__('Go to Home Page'), 'link' => Mage::getBaseUrl()));
         $breadcrumbs->addCrumb('cms_page', array('label' => $page->getTitle(), 'title' => $page->getTitle()));
     }
     $root = $this->getLayout()->getBlock('root');
     if ($root) {
         $root->addBodyClass('cms-' . $page->getIdentifier());
     }
     $head = $this->getLayout()->getBlock('head');
     if ($head) {
         $head->setTitle($page->getTitle());
         $head->setKeywords($page->getMetaKeywords());
         $head->setDescription($page->getMetaDescription());
         $head->setRobots($page->getMetaRobots());
     }
     return parent::_prepareLayout();
 }