Help - Search - Members - Calendar
Full Version: link to previous entry (archived)
Movable Type Community Forum > Additional Resources > Tips and Tricks
lynda
Well, that looks like the right format.

I'm thinking perhaps the Previous/Next can only be used in Date-Based Archives (for archiveprevious/next) and Individual Templates (for entryprevious/next)

I couldn't find anything in the manual specifically stating this limitation though.
vanillabean
thanks lynda. yes, my main page will only show one entry and i wanted a link that would take me to the previous entry. and from the previous entries, i wanted links that would take me to the entries before and after that entry.

i've played around with it but i suppose it's just not working. maybe i just might drop the preiouvs/next links altogether.

thanks for the feedback! smile.gif
vanillabean
sorry if my question appears obvious to some of you but i just really want to know.

in my index file, while trying to link to a previous archived entry, this is the code i'm using

CODE
<MTEntryPrevious>
<a href="<$MTEntryLink$>"><< before</a>
</MTEntryPrevious>


it looks ok on the screen. but when i click onto the link, it just takes me to the same entry, and not the previous one.

does someone know what i did wrong or how i can fix this? i would really appreciate it! thanks!

(currently set to "individual" archive)
lynda
Here's a suggestion though that might work.  Not sure why you'd need to link to the previous entry from the main page unless you were setting up some sort of journal and you wanted the main page to be the latest entry.

If it's something like that, where only one entry is on the page, you might be able to do something like this...


CODE
<MTEntries lastn="1" offset="1">
<a href="<$MTEntryLink$>"><<before</a>
</MTEntries>


I haven't played around with offset yet, but if I understand it correctly, this should provide a link to one post starting one post BEFORE the current post.  In other words, the previous post.

Again, if this works, it probably won't work too well if you have more than one entry per page (but if that's the case, you don't really need the before link)
girlie
I use previous and next links on my journal archive pages (individual) without any problems - the only thing I don't do is have my latest entry on my main index page (because I use a calendar display for that).

However, just for kicks, I created a test index page and copied the previous code vanillabean cited - and it worked just fine for me.

This is what the entire section of MT code looks like on that test page:

CODE
<MTEntries lastn="1">
<MTDateHeader>
<$MTEntryDate format="%B %d, %Y"$>
</MTDateHeader>
<a name="<$MTEntryID pad="1"$>"></a>
<$MTEntryTitle$>    
<$MTEntryBody$>
<MTEntryPrevious>
<a href="<$MTEntryLink$>"><< before</a>
</MTEntryPrevious>  
</MTEntries>


Don't know if it matters that on the index page, it's included within the MTEntries tags - on the individual page, no MTEntries tags are required to get it to work.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.