Not a developer? Go to MovableType.com

News

Features of 4.3: Entry Pagination

By Matt Jacobs
Posted July 24, 2009, in News.

Up until the general release of MT 4.3 (beta info here), we are publishing details on the features of 4.3. Today we're looking at entry pagination.

1,000 Entries

One of the categories on my blog is now up to nearly 1,000 entries and it has become difficult to display them. Movable Type offers the ability to split up the category content by date (e.g., Category-Monthly archives), but that would still require me to publish all of the content statically. I could use dynamic publishing, but then I would lose the speed of a statically published page on the front-end.

Situations like these, and a long-standing pubilc request, is why we're now introducing a dynamic way to paginate your index and archive templates using MT-Search. With this solution, you're able to publish the first 10 or 20 (or whatever you'd like) entries statically and paginate through the remainder dynamically. What's even better is that it only requires a few changes to your index or archive template to generate the content for MT-Search.

Getting Pagination on Your Blog

We've put together a guide to paginating with static templates that provides details on the new querystring parameters and sample template code. It's based on the classic template set included in MTOS, but could certainly be used as an example for other template sets. If you see any issues or improvements we can make, please leave comments here or on that page!

Bonus Feature!

In addition to allowing for entry pagination, you can now limit your searches by author, category or date. For example, if I was going to search my blog for 'sneaker', the URL would look like this:

http://mydomain.com/cgi-bin/mt/mt-search.cgi?IncludeBlogs=1&search=sneaker

If I wanted it to limit it to only entries in 2007, I'd use this:

http://mydomain.com/cgi-bin/mt/mt-search.cgi?IncludeBlogs=1&search=sneaker&archive_type=Yearly&year=2007

If I only wanted to look in the category 'Design', which has an ID of 40, I'd use this:

http://mydomain.com/cgi-bin/mt/mt-search.cgi?IncludeBlogs=1&search=sneaker&category=40

And if I wanted to limit to an author with the ID of 2, I'd use this:

http://mydomain.com/cgi-bin/mt/mt-search.cgi?IncludeBlogs=1&search=sneaker&author=2

The one caveat here is that, unlike entry pagination, you'll need to use the search template for these. See the entry pagination guide for more details.

Back

14 Comments

Anil Dash

Anil Dash on July 24, 2009, 10:57 a.m. Reply

Ooh, this one’s exciting! I’m hoping the community can collaborate on some good docs for making an .htaccess file to give pretty URLs to some of those forms of querying.

Pouya Salimi

Pouya Salimi on July 24, 2009, 2:59 p.m. Reply

mt-search.cgi make server load up, think about it and other is mt-ftsearch.cgi not work with UTF-8 languages.

Sabine

Sabine on July 25, 2009, 2:15 p.m. Reply

Nice, this would solve Bug-ID 90227
mt-search.cgi?IncludeBlogs=1&search=sneaker&category=40

Matt Jacobs

Matt Jacobs on July 30, 2009, 8:06 a.m. Reply

Sabine, It doesn’t exactly solve the bug, but it gives an excellent work around!

jeux en ligne

jeux en ligne on January 10, 2010, 8:51 a.m. Reply

whew, my problem and finally resolved, I confirm that remains regardless of technical bug! thank you for this best work

Russell

Russell on July 18, 2012, 11:56 a.m. Reply

This one is much better. But how it deals with the duplicate content which will make Google push the site down in SERP?

Romeo Johnson

Romeo Johnson on September 2, 2012, 7:54 p.m. Reply

Pagination is great, but in Wordpress it is made only by activating a simple plugin. You don’t need any code skills to do it. It is a bit harder here.

Ashley Morgan

Ashley Morgan on September 11, 2012, 11:26 p.m. Reply

Well, it is a bit harder, but even in Wordpress you need to place some code to point where you want to place the pagination. However, MT has many advantages compared with Wordpress and some of it is the people like Matt and Beau who can be asked anytime anything. Try this on Wordpress and see the result.

Phil

Phil on October 4, 2012, 1:14 a.m. Reply

It is a very clever way to improve the visibility of the entries. I agree that in Wordpress is a bit easier, but here the possibilities are many more as the author has shown.

Mick Hannigan

Mick Hannigan on October 22, 2012, 2:51 a.m. Reply

It is really a great way to improve the vision of the site, but is it possible to add the function these pages not to be indexed by the search machines?

Ola Mattsen

Ola Mattsen on October 30, 2012, 1:11 a.m. Reply

Mick, you can add a nofollow sign manually into the code. You can also add the noindex tag which also should do the job.

Margaret Thompson

Margaret Thompson on November 7, 2012, 6:29 a.m. Reply

This smart search is seems very handy :) I would like to try it, but I can’t understand what template ID should I use for this feature to work correctly?

derek johnson

derek johnson on November 19, 2012, 4:58 a.m. Reply

Hi, I have a question :) To limit the searches in my Movable Type site only in one category should the reader do something more specific or I as the owner of the site am the man who decide where the reader would be able to search?

Scotty

Scotty on November 28, 2012, 3:48 a.m. Reply

I’ve made a silly mistake and my year displaying is with just two numbers 12 f.e. How can I set up the pagination per year as in the main code the year pagination is with four?