_addBreadcrumbs(); $this->pageConfig->getTitle()->set($this->_getConfigValue('title')); $this->pageConfig->setKeywords($this->_getConfigValue('meta_keywords')); $this->pageConfig->setDescription($this->_getConfigValue('meta_description')); $this->pageConfig->addRemotePageAsset( $this->_url->getBaseUrl(), 'canonical', ['attributes' => ['rel' => 'canonical']] ); return parent::_prepareLayout(); } /** * Prepare breadcrumbs * * @throws \Magento\Framework\Exception\LocalizedException * @return void */ protected function _addBreadcrumbs() { if ($this->_scopeConfig->getValue('web/default/show_cms_breadcrumbs', ScopeInterface::SCOPE_STORE) && ($breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs')) ) { $breadcrumbsBlock->addCrumb( 'home', [ 'label' => __('Home'), 'title' => __('Go to Home Page'), 'link' => $this->_storeManager->getStore()->getBaseUrl() ] ); $breadcrumbsBlock->addCrumb( 'blog', [ 'label' => __('Blog'), 'title' => __(sprintf('Go to Blog Home Page')) ] ); } } /** * Retrieve blog title * @return string */ protected function _getConfigValue($param) { return $this->_scopeConfig->getValue( 'mfblog/index_page/'.$param, ScopeInterface::SCOPE_STORE ); } }