root/trunk/HybridPagination/README.txt

Revision 1340, 2.4 kB (checked in by bchoate, 12 months ago)

Initial checkin.

  • Property svn:keywords set to Id Revision
Line 
1Hybrid Pagination, a plugin for Movable Type
2=============================================
3
4This plugin provides a means for doing pagination of a template module
5in Movable Type. It expects the following:
6
7* An index template that is statically published, as a PHP file.
8* A template module that is written to support pagination.
9
10From the index template, you would make use of the "PaginateModule"
11MT tag which is provided by this plugin. It works much like the MT
12"Include" tag, when used with a "module" attribute. For example:
13
14    <$MTPaginateModule module="Entries Loop"$>
15
16The template module should look something like this (paginates by 20 entries):
17
18    <MTEntries offset="auto" lastn="20">
19
20        (place your entry summary markup here)
21
22    <mt:IfStatic>
23    <mt:EntriesFooter>
24        <mt:EntryNext setvar="has_more">1</mt:EntryNext>
25    </mt:EntriesFooter>
26    </mt:IfStatic>
27    </MTEntries>
28
29    <div class="content-nav">
30    <mt:IfDynamic>
31    <mt:IfPreviousResults>
32        <a rel="prev" href="<$mt:NextLink>">&lt; Older &nbsp;</a>
33    </mt:IfPreviousResults>
34    <mt:PagerBlock>
35        <mt:IfCurrentPage>
36            <$mt:Var name="__value__"$>
37        <mt:Else>
38            <a href="<$mt:PagerLink$>"><$mt:Var name="__value__"$></a>
39        </mt:IfCurrentPage>
40        <mt:Unless name="__last__">&nbsp;</mt:Unless>
41    </mt:PagerBlock>
42    <mt:IfMoreResults>
43        <a rel="next" href="<$mt:PreviousLink$>">&nbsp; Newer &gt;</a>
44    </mt:IfMoreResults>
45    </mt:IfDynamic>
46    <mt:IfStatic>
47    <mt:If name="has_more">
48        <a rel="prev" href="?offset=20">&lt; Older</a>
49    </mt:If>
50    </mt:IfStatic>
51    </div>
52
53This produces a simple single "Older" link for the statically published
54page which takes you to the hybrid static and dynamic page, which then
55offers full navigation for the module. If you are paginating something
56other than a MTEntries tag, you can use the same mechanism, but you may
57need to gather the 'offset' query parameter manually and use it to
58display the range of results you desire.
59
60Installation
61-------------
62
63To install this plugin, drop the files included with this plugin into your
64Movable Type directory (under the plugins/HybridPagination directory).
65
66For a guide to installing Movable Type plugins packaged in this way, please
67visit http://tinyurl.com/6dfsm3
68
69License
70--------
71
72This plugin has been released under the terms of the GNU Public License,
73version 2.0.
Note: See TracBrowser for help on using the browser.