Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added skeleton of usage documentation

  • Loading branch information...
commit 2ead9c24b652a608888bd34cd436e7c384dc5dc7 1 parent 2d1e761
Tom Gross authored
Showing with 49 additions and 0 deletions.
  1. +1 −0  README.rst
  2. +48 −0 USAGE.rst
View
1  README.rst
@@ -18,6 +18,7 @@ Contents:
CHANGES
plone/batching/batching
+ USAGE
.. automodule:: plone.batching.batch
:members:
View
48 USAGE.rst
@@ -0,0 +1,48 @@
+Batch navigation in templates
+-----------------------------
+
+For the use of batching features in Page Templates *plone.batching*
+the first thing you have to do is to create a sequence batch and put
+it in a template variable named *batch*.
+You should do this in a view class if possible ::
+
+ <div tal:define="batch view/batchresults;">
+
+or you can do it in the template itself if necessary ::
+
+ <div tal:define="Batch python:modules['Products.CMFPlone'].Batch;
+ b_size python:30;b_start python:0;b_start request/b_start | b_start;
+ batch python:Batch(results, b_size, int(b_start), orphan=1);">
+
+For the navigation you add the following snippet to your template ::
+
+ <tal:batchnavigation
+ define="batchnavigation nocall:context/@@batchnavigation"
+ replace="structure python:batchnavigation(batch)" />
+
+For backwards compatibility *plone.batching* provides a drop in metal macro
+*navigation* in the *batch_macros* template. Add it to the template like this::
+
+ <div metal:use-macro="context/batch_macros/macros/navigation" />
+
+
+Usage in Python code
+--------------------
+
+XXX
+
+Usage in Views
+--------------
+
+XXX
+
+Customized batching
+-------------------
+
+XXX
+
+Incompatibilities
+-----------------
+
+XXX __len__ method
+
Please sign in to comment.
Something went wrong with that request. Please try again.