Help - Search - Members - Calendar
Full Version: Recent posts (MTEntries) question
Movable Type Community Forum > Additional Resources > Tips and Tricks
ke493
Right now, I'm displaying a "Recent Entries" section on my various blog pages, along with a "lastn" tag so it just shows the 10 most recent entries.

Things are fine on my home page, and on individual entry pages. But for some reason, on my category and date (monthly) archive pages, the recent entries are all pulled from the respective archive.

In other words, if I look at my "October 2002" page, my recent posts list only shows posts from October 2002, rather than listing my most recent posts blog-wide (eg. posts I made today, yesterday, etc.). Looking at the MT documentation, I can see that it is possible to restrict the MTEntries tag to category for example, but I have no such filter specified in my code. I'm stumped.

Code for Category archive page:
CODE
<!-- recent posts navigation -->

<h3>Recent Posts</h3>

<MTEntries lastn="10">
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a><br />
</MTEntries>
<br>


Code for monthly archive page:
CODE
<!-- recent posts navigation -->

<h3>Recent Posts</h3>

<MTEntries lastn="10">
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a><br />
</MTEntries>
<br>


my code for individual archives, which DON'T have this problem:

CODE
<!-- recent posts navigation -->

<h3>Recent Posts</h3>

<MTEntries lastn="10">
<a href="<$MTEntryLink$>"><$MTEntryTitle$></a><br />
</MTEntries>
<br>


So you can see they're identical....is there something I need to change elsewhere in the template?

Site URL is here.

Thanks!
girlie
The way to do this is to put the Recent Entries code in a new Index Template, and include the output file in the archive pages with SSI or PHP.

Because a Category or Date Based Archive is designed to display only specific entries (i.e., in that category or that month), the MTEntries tag displays only the entries in that context (in fact, if you look at those templates, you'll see they already have MTEntries tags in them which behave in that exact manner).
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.