/**
  * Golbal Prepare Layout
  *
  * @return $this
  */
 public function _prepareLayout()
 {
     $this->_addBreadcrumbs();
     $this->pageConfig->getTitle()->set("Blog");
     $pager = $this->getLayout()->createBlock('Magento\\Theme\\Block\\Html\\Pager');
     $pager->setShowPerPage("2");
     $pager->setCollection($this->getPostCollection());
     $this->setChild("posts.pager", $pager);
     parent::_prepareLayout();
 }
示例#2
0
 public function _prepareLayout()
 {
     $brand = $this->getBrand();
     $pageMainTitle = $this->getLayout()->getBlock('page.main.title');
     if ($pageMainTitle) {
         $pageMainTitle->setPageTitle($brand->getName());
     }
     $this->pageConfig->getTitle()->set($brand->getTitle());
     $this->pageConfig->setKeywords($brand->getTitle());
     $this->pageConfig->setDescription($brand->getTitle());
     return parent::_prepareLayout();
 }
示例#3
0
 /**
  * Process title
  *
  * @param \Magento\Framework\View\Page\Config\Structure $pageStructure
  * @return $this
  */
 protected function processTitle(Structure $pageStructure)
 {
     if ($pageStructure->getTitle()) {
         $this->pageConfig->getTitle()->set($pageStructure->getTitle());
     }
     return $this;
 }
 /**
  * {@inheritdoc}
  */
 public function getTitle()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getTitle');
     if (!$pluginInfo) {
         return parent::getTitle();
     } else {
         return $this->___callPlugins('getTitle', func_get_args(), $pluginInfo);
     }
 }
示例#5
0
 /**
  * Prepare global layout
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     $page = $this->getPage();
     $this->_addBreadcrumbs($page);
     $this->pageConfig->addBodyClass('cms-' . $page->getIdentifier());
     $this->pageConfig->getTitle()->set($page->getTitle());
     $this->pageConfig->setKeywords($page->getMetaKeywords());
     $this->pageConfig->setDescription($page->getMetaDescription());
     $pageMainTitle = $this->getLayout()->getBlock('page.main.title');
     if ($pageMainTitle) {
         // Setting empty page title if content heading is absent
         $cmsTitle = $page->getContentHeading() ?: ' ';
         $pageMainTitle->setPageTitle($this->escapeHtml($cmsTitle));
     }
     return parent::_prepareLayout();
 }
示例#6
0
 public function testGetTitle()
 {
     $this->assertInstanceOf('\\Magento\\Framework\\View\\Page\\Title', $this->model->getTitle());
 }
示例#7
0
 /**
  * @return string
  */
 public function renderTitle()
 {
     return '<title>' . $this->escaper->escapeHtml($this->pageConfig->getTitle()->get()) . '</title>' . "\n";
 }