| 1 | Hybrid Pagination, a plugin for Movable Type |
|---|
| 2 | ============================================= |
|---|
| 3 | |
|---|
| 4 | This plugin provides a means for doing pagination of a template module |
|---|
| 5 | in 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 | |
|---|
| 10 | From the index template, you would make use of the "PaginateModule" |
|---|
| 11 | MT 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 | |
|---|
| 16 | The 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>">< Older </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__"> </mt:Unless> |
|---|
| 41 | </mt:PagerBlock> |
|---|
| 42 | <mt:IfMoreResults> |
|---|
| 43 | <a rel="next" href="<$mt:PreviousLink$>"> Newer ></a> |
|---|
| 44 | </mt:IfMoreResults> |
|---|
| 45 | </mt:IfDynamic> |
|---|
| 46 | <mt:IfStatic> |
|---|
| 47 | <mt:If name="has_more"> |
|---|
| 48 | <a rel="prev" href="?offset=20">< Older</a> |
|---|
| 49 | </mt:If> |
|---|
| 50 | </mt:IfStatic> |
|---|
| 51 | </div> |
|---|
| 52 | |
|---|
| 53 | This produces a simple single "Older" link for the statically published |
|---|
| 54 | page which takes you to the hybrid static and dynamic page, which then |
|---|
| 55 | offers full navigation for the module. If you are paginating something |
|---|
| 56 | other than a MTEntries tag, you can use the same mechanism, but you may |
|---|
| 57 | need to gather the 'offset' query parameter manually and use it to |
|---|
| 58 | display the range of results you desire. |
|---|
| 59 | |
|---|
| 60 | Installation |
|---|
| 61 | ------------- |
|---|
| 62 | |
|---|
| 63 | To install this plugin, drop the files included with this plugin into your |
|---|
| 64 | Movable Type directory (under the plugins/HybridPagination directory). |
|---|
| 65 | |
|---|
| 66 | For a guide to installing Movable Type plugins packaged in this way, please |
|---|
| 67 | visit http://tinyurl.com/6dfsm3 |
|---|
| 68 | |
|---|
| 69 | License |
|---|
| 70 | -------- |
|---|
| 71 | |
|---|
| 72 | This plugin has been released under the terms of the GNU Public License, |
|---|
| 73 | version 2.0. |
|---|