示例#1
0
 /**
  * Add meta information from product to head block
  * @return Mage_Catalog_Block_Product_View
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $headBlock = $this->getLayout()->getBlock('head');
     if ($headBlock) {
         $product = $this->getProduct();
         // SEO Page title
         $title = array();
         if ($product = $this->getProductData()) {
             $title[] = $product->getName() . ' Review';
         }
         if ($review = $this->getReviewData()) {
             $title[] = $review->getTitle();
         }
         $title = implode(' - ', $title);
         $headBlock->setTitle($title);
         // Remove Canonical Url if set
         if (method_exists($this->helper('catalog/product'), 'canUseCanonicalTag')) {
             if ($this->helper('catalog/product')->canUseCanonicalTag()) {
                 foreach ($headBlock->getItems() as $item) {
                     if (isset($item['params']) && is_string($item['params']) && $item['params'] == 'rel="canonical"') {
                         $headBlock->removeItem('link_rel', $item['name']);
                     }
                 }
                 //$params = array('_ignore_category'=>true);
                 //$headBlock->addLinkRel('canonical', Mage::registry('current_review')->getReviewUrl());
             }
         }
     }
     return $this;
 }
示例#2
0
 public function _prepareLayout()
 {
     return parent::_prepareLayout();
 }