1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * Copyright © 2015 Ihor Vansach (ihor@magefan.com). All rights reserved.
- * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
- *
- * Glory to Ukraine! Glory to the heroes!
- */
- namespace Magefan\Blog\Block;
- use Magento\Store\Model\ScopeInterface;
- /**
- * Blog index block
- */
- class Index extends \Magefan\Blog\Block\Post\PostList
- {
- /**
- * Preparing global layout
- *
- * @return $this
- */
- protected function _prepareLayout()
- {
- $this->_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();
- }
- /**
- * Retrieve blog title
- * @return string
- */
- protected function _getConfigValue($param)
- {
- return $this->_scopeConfig->getValue(
- 'mfblog/index_page/'.$param,
- ScopeInterface::SCOPE_STORE
- );
- }
- }
|