Not a developer? Go to MovableType.com

Documentation

Pagination for Dynamic Publishing

Notice: Because the feature described below is not added in default templates, so no QA to this specific feature could be done, this feature should be considered EXPERIMENTAL.

Movable Type 4.2 introduced the ability to paginate any dynamically published archive template. This document gives an overview of how to turn on pagination for your templates.

System Requirements

By default Movable Type handles dynamic publishing via use of the ErrorDocument Apache configuration directive. To enable pagination however you will need to change this default behavior in favor of a RewriteRule configuration directive.

Editing Your Apache Configuration

If you have existing .htaccess file in your blog's site path, open and edit it in your favorite text editor. Look for a line that looks like this:

 RewriteRule ^(.*)$ $mtview_server_url [L,QSA]

Change it to the following:

 RewriteRule ^(.*)(\?.*)?$ $mtview_server_url$2 [L,QSA]

Editing Your Templates

Copy the following code to your clipboard:

<div class="content-nav">
  <MTIfPreviousResults><a href="<MTPreviousLink>" rel="prev">
           &laquo; Previous</a>&nbsp;&nbsp;</MTIfPreviousResults>
  <MTPagerBlock>
    <MTIfCurrentPage><MTVar name="__value__"><MTElse><a href="<MTPagerLink>"><MTVar name="__value__"></a></MTIfCurrentPage>
    <mt:unless name="__last__">&nbsp;</mt:unless>
  </MTPagerBlock>
 <MTIfMoreResults>&nbsp;&nbsp;<a href="<MTNextLink>" rel="next">
         Next &raquo;</a>
 </MTIfMoreResults>
</div>

Edit your Category Entry Listing archive template and paste it above the existing <div class="content-nav"> block.

Then find the <MTEntries> tag in the template and either add or change the offset modifier to "auto". Set the lastn and limit modifiers to 10, or the number of entries you prefer to display per page.

Set the template or archive map to publish dynamically and you are done.

Back

Leave a Comment

1 Comment

LaRosa Johnson

LaRosa Johnson on May 31, 2008, 3:08 p.m. Reply

I gave this a try and it looks like you also need to add the lastn modifier and set it to the same value as the limit modifier for it to work properly, at least in my case.

By the way, this is a great feature!