通过Plone中的页面模板分页

Hel*_*ujo 4 pagination plone

我正在寻找一个关于如何使用Batch TAL宏来分页文件夹内容的示例.直到知道没有发现任何解释该怎么做.有谁知道这样的例子?

提前致谢.

此致,Helio

Jih*_*sse 6

那样的东西?

<div tal:define="liste python:here.portal_catalog.searchResults({'portal_type' : 'News Item',   'review_state':'published'});
             Batch python:modules['Products.CMFPlone'].Batch;
             b_size python:20;
             b_start python:0;
             b_start request/b_start | b_start;
             batch python:Batch(liste, b_size, int(b_start), orphan=1);"
     tal:condition="liste">

    <ul>

        <tal:boucle tal:repeat="item batch">
            <li tal:define="oddrow repeat/item/odd;" 
                tal:attributes="class python:test(oddrow, 'even', 'odd')">

                 <!-- stuff -->

            </li>
        </tal:boucle>

    </ul>

    <div metal:use-macro="here/batch_macros/macros/navigation" />

</div>
Run Code Online (Sandbox Code Playgroud)