Help - Search - Members - Calendar
Full Version: Link to "MTentries lastn" doesn't work?!
Movable Type Community Forum > Using Movable Type > Templates and Tags
marti
Hi there!

In my sidebar, I'd like to link to the last 20 entries. Right now I've got this code in my main index template:

QUOTE
[div class="sidetitle"]De laatste 20[/div]
[br /]
[MTEntries lastn="20"]
[a class="menu" href="[$MTEntryLink$]"][$MTEntryTitle$][/a][br /]
[/MTEntries]
[br /]

[ and ] obviously stand for < and >


When you now click any of the 20 titles, nicely listed in my sidebar, MT opens the archive at the top of the page. Not really what I wanted, of course. I've only got a monthly archive - I've been told it should still work, but obviously it doesn't.

What am I doing wrong here?
kadyellebee
Try this instead smile.gif  It points to the entry directly on the monthly page.

CODE
<a class="menu" href="<$MTEntryLink$>#<$MTEntryID pad="1"$>"><$MTEntryTitle$></a><br />


Kristine
marti
Hi Kristine,

Looks like it should work! However, I now get errors rebuilding, even after playing around with the tags. So I've gone back to where we started, and I now have the following code:

CODE
<div class="sidetitle">De laatste 20</div>
<br />
<MTEntries lastn="20">
<a class="menu" href="<$MTEntryLink$>#<$MTEntryID pad="1"$>"><$MTEntryTitle$></a>
</MTEntries><br />


Wich should do the trick, exept for the error when rebuilding:

CODE
Build error in template 'Main Index': Error in <MTArchiveList> tag: Error in <MTEntryLink> tag: You used an 'MTEntryLink' tag outside of the context of an entry; perhaps you mistakenly placed it outside of an 'MTEntries' container?


As I said, I've tried to get around it, but no luck ... huh.gif
kadyellebee
It sounds like maybe you have a MTArchiveList tag somewhere in your template that isn't ended - the code you posted should work just fine, but the error message starts with telling you about an MTArchiveList tag being weird.

Check that out!
Kristine
marti
That's what I thought, but I only changed this little bit of code and didn't get the error before. Can't find any other missing tag, but I'll have some fresh eyes look just to be sure  :)
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-2010 Invision Power Services, Inc.