hasData('show_type') && $this->getData('show_type') === 'category') { $collection = $this->helperData->getObjectByParam($this->getData('category_id'), null, Data::TYPE_CATEGORY) ->getSelectedPostsCollection(); $this->helperData->addStoreFilter($collection); } else { $collection = $this->helperData->getPostList(); } $collection->setPageSize($this->getData('post_count')); return $collection; } /** * @return Data */ public function getHelperData() { return $this->helperData; } /** * @return mixed */ public function getTitle() { return $this->getData('title'); } /** * @param $code * * @return string */ public function getBlogUrl($code) { return $this->helperData->getBlogUrl($code); } /** * Render block HTML * * @return string */ protected function _toHtml() { if ($this->helperData->checkHyvaTheme()) { $this->setTemplate('Mageplaza_Blog::hyva/widget/posts.phtml'); } return parent::_toHtml(); } }