我想在PrestaShop 1.7 中创建一个分页
我有一个带有数组的函数,我将其分配给.tpl
模板
$brands = $this->getBrands();
$this->context->smarty->assign($brands);
parent::initContent();
$this->setTemplate('brandschr.tpl');
我没有找到太多关于如何使用pagination.tpl
的信息,也没有找到如何使用的例子
如果你以前做过,请把你的想法发给我,或者给我举个例子。
我建议您只灵活可变地分配给需要的页面。假设你想在自定义分页中添加品牌,你只在实际包含品牌的页面上分配。
$brands = $this->getBrands();
$this->context->smarty->assign($customPagination);
然后在/templates/_partials/pagination.tpl
的主题中创建一个覆盖。在这个文件中,只需检查您的";customPagination";isset,然后显示您的custom-pagination.tpl
(brandschr.tpl
(
这将保持原始PS分页的完整性。