Exemplo n.º 1
0
 /**
  * Preparing global layout
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     $post = $this->getPost();
     $this->_addBreadcrumbs($post);
     $this->pageConfig->addBodyClass('blog-post-' . $post->getIdentifier());
     $this->pageConfig->getTitle()->set($post->getTitle());
     $this->pageConfig->setKeywords($post->getMetaKeywords());
     $this->pageConfig->setDescription($post->getMetaDescription());
     return parent::_prepareLayout();
 }
Exemplo n.º 2
0
 /**
  * Preparing global layout
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     $post = $this->getPost();
     if ($post) {
         $this->_addBreadcrumbs($post);
         $this->pageConfig->addBodyClass('blog-post-' . $post->getIdentifier());
         $this->pageConfig->getTitle()->set($post->getMetaTitle());
         $this->pageConfig->setKeywords($post->getMetaKeywords());
         $this->pageConfig->setDescription($post->getMetaDescription());
         $this->pageConfig->addRemotePageAsset($post->getPostUrl(), 'canonical', ['attributes' => ['rel' => 'canonical']]);
     }
     return parent::_prepareLayout();
 }