getModuleLink('jxblog', 'categories')); } if (Tools::getIsset('page') && $page = Tools::getValue('page')) { $this->page = $page; } parent::__construct(); $this->itemPerPage = Configuration::get('JXBLOG_POSTS_PER_PAGE'); } public function initContent() { parent::initContent(); $pagination = false; $categories = JXBlogCategory::getAllFrontCategories( 2, $this->context->language->id, $this->context->shop->id, $this->context->customer->id_default_group, 1, 1000 ); $posts = JXBlogPost::getAllPosts($this->context->language->id, $this->context->shop->id, $this->context->customer->id_default_group, $this->page, $this->itemPerPage); if ($posts) { $pagination = $this->module->buildPagination( 'bpagination', JXBlogPost::countAllPosts( 2, $this->context->shop->id, $this->context->customer->id_default_group ), $this->page, $this->itemPerPage ); } $this->context->smarty->assign( array( 'categories' => $categories, 'posts' => $posts, 'pagination' => $pagination ) ); $this->setTemplate('module:jxblog/views/templates/front/blog.tpl'); } public function getBreadcrumbLinks() { $link = new Link(); $breadcrumb = parent::getBreadcrumbLinks(); $breadcrumb['links'][] = array('title' => $this->module->translator('blog'), 'url' => $link->getModuleLink('jxblog', 'blog')); return $breadcrumb; } }