Neh*_*iah 2 liquid business-catalyst
所有图像都加载在同一页面中,我如何控制使用分页?任何人都可以帮我解决这个问题.
这是我的代码.
{module_photogallery id="123456" collection="test2016" template="" }
<div class="container">
<div class="row">
{% for item in test2016.items %}
<div class="col-md-3 col-sm-3 col-xs-6">
<a onclick="myLightbox.start(this);return false;" rel="lightbox[photo2015]" href="{{item.link}}">
<img src="{{item.link}}?Action=thumbnail&Width=250&Height=150&algorithm=fill_proportional">
</a>
</div>
{% endfor %}
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
BC提供了分页对象来完成它.该对象为您提供了6个参数:currentPage,itemsPerPage,numberOfPages,totalItemsCount,previousPageUrl,nextPageUrl.首先,您需要将resultsPerPage =""添加到初始photogallery模块标记,然后添加,例如{{test2016.pagination.previousPageUrl}}作为锚标记的href以获取上一页链接.
这取决于你想要什么,但你最终会得到这样的东西:
{module_photogallery id="12345" resultsPerPage="6" collection="test2016" template="" }
<div class="container">
<div class="row">
{% for item in test2016.items %}
<div class="col-md-3 col-sm-3 col-xs-6">
<a onclick="myLightbox.start(this);return false;" rel="lightbox[photo2015]" href="{{item.link}}">
<img src="{{item.link}}?Action=thumbnail&Width=250&Height=150&algorithm=fill_proportional">
</a>
</div>
{% endfor %}
<a href="{{test2016.pagination.previousPageUrl}}">Prev</a> <a href="{{test2016.pagination.nextPageUrl}}">Next</a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
使用一些if ... then语句和一些其他参数来准确得到你想要的.
| 归档时间: |
|
| 查看次数: |
178 次 |
| 最近记录: |