/** * Get a pager * * @return string|null */ public function getPager() { $pager = $this->getChildBlock('news_list_pager'); if ($pager instanceof \Magento\Framework\Object) { $newsPerPage = $this->_dataHelper->getNewsPerPage(); $pager->setAvailableLimit([$newsPerPage => $newsPerPage]); $pager->setTotalNum($this->getCollection()->getSize()); $pager->setCollection($this->getCollection()); $pager->setShowPerPage(TRUE); $pager->setFrameLength($this->_scopeConfig->getValue('design/pagination/pagination_frame', \Magento\Store\Model\ScopeInterface::SCOPE_STORE))->setJump($this->_scopeConfig->getValue('design/pagination/pagination_frame_skip', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)); return $pager->toHtml(); } return NULL; }
/** * Return URL for resized News Item image * * @param Magentostudy_News_Model_News $item * @param integer $width * @return string|false */ public function getImageUrl($item, $width) { return $this->_dataHelper->resize($item, $width); }