我正在使用带有变色龙的金字塔,我尝试将一个类添加到一个依赖于页码的链接:条件。当我将 page_number 替换为字符串时,它正在工作,但下面的代码却没有。所以 page_number 有问题。任何帮助,将不胜感激
<div tal:repeat="page_number range(pages['min'],(pages['max']+1))">
<a tal:condition="request.matchdict['page_number'] is page_number"
href="${request.route_url('results', page_number=page_number, searchQuery=request.matchdict['searchQuery'])}"
class="page-nav-link">${page_number}
</a>
<a tal:condition="request.matchdict['page_number'] is not page_number"
href="${request.route_url('results', page_number=page_number, searchQuery=request.matchdict['searchQuery'])}"
class="page-nav-selected">${page_number}
</a>
</div>