tips and tricks for movable type
next N and previous N entries
May 07, 2003
Stepan posted this nifty little trick to get the last N previous and next entries - nest multiple <MTEntryNext> and <MTEntryPrevious> tags!
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a>
<MTEntryNext>
: <a href="<$MTEntryLink$>"><$MTEntryTitle$></a>
<MTEntryNext>
: <a href="<$MTEntryLink$>"><$MTEntryTitle$></a>
</MTEntryNext>
</MTEntryNext>
</MTEntryNext>
Use the same pattern with <MTEntryPrevious>; repeat the loop for the number of previous/next entries you want to link to.
Update 12.07.03: Here's an example of what Lummox is talking about in his comment below (taken from this forum topic):
<a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a><br />
<$MTAgainHere$>
</MTEntryNext></MTAgain>
As he notes in that same topic: "If you use this in an individual archive template and want the next 5 to rebuild properly with each entry, then you'll need to use the Rebuild plugin, and put the MTRebuildEntry tag before or after the link. (Without it, only the immediate next/previous entries are rebuilt.)"
TrackBack: 2
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/150)
» Girlie's MT Tips and Tricks
Excerpt: http://www.thegirliematters.com/tips/
Weblog: blog^2
Tracked: 05.25.03 10:50 AM
» Next N :: Previous N entries for archived Recent Entries display
Excerpt: Next N :: Previous N from girliematters.com Once I get formatting for individual archives, I can add this. p. /" target="_blank">" hspace="4" align="right" border="0">Presently listening to:Shine on You Crazy Diamond, Pts. 1-5 - Pink Floyd - Wish You W...
Weblog: My Messy Workbench
Tracked: 01.18.04 02:20 PM
Comments
The Again plugin can be used to handle this nesting quickly if you're doing more than just a few.
Also, authors should be aware that the previous entries won't be rebuilt automatically when you add a new one; only the immediately previous entry is rebuilt, because of the way MT's rebuilding works. If you want to rebuild all N of them, use the Rebuild plugin to force the build.
Hi
I have only category-based archives and no individual entry either as index or as archives. How can I show the latest 5 blogs in the first index page and the earlier ones in another page in the same directory linked to the main index page as "earler blogs" and back as "Latest Blogs"?
I think I have made myself clear.
PLease tell me how to achievw this.
Thanks
S.K