Help - Search - Members - Calendar
Full Version: Multiple entries on main index (per day)
Movable Type Community Forum > Additional Resources > Tips and Tricks
girlie
I think this is simply a result of how MT is designed.

days=N means the last N consecutive days, not the last N days on which you made a post. So if you set your days to 1, and you don't post for a day, then MT will roll all posts less than 1 day old off your page. (I'm not sure if a "day" is the last 24 hours, or an actual calendar day, I'm guessing the latter from what you describe).

lastn is designed to control the number of entries displayed, regardless of the dates on which they were posted.

I personally don't know of any way to get around this (sorry, I'm sure that isn't what you wanted to hear). But there are lots of people on this forum, so maybe someone will have a workable suggestion.
bmk
I don't know what I am talking about.  That isn't going to work. :p
girlie
I kept thinking "SSI" in my head, but totally forgot about daily archiving!!

:0
SimonP
Thanks folks for all your replies!

Ben, I use PHP on my site, because my site is skinned (or will be shortly). So, I can't use .shtml files - is there anyway of doing this with PHP?

Thanks,
Simon
SimonP
Hi all,

I've just starting getting into weblogs, and I designed to have entries for the current day on the main index.

However, if I use MTEntries days="1", then if I haven't posted any entries today, then I just get a blank page (in other words, it doesn't show the previous entry).

So, I tried MTEntries lastn="1", and this works, but it doesn't work if I have more than one entry per day.

Could anyone offer any assistance as to how I can get MT to display multiple entries for one day please?

Many thanks,
Simon.
bmk
Simon,

Just create only one post per day and keep adding to it!  jk  :p

I was trying think of a way to do this too.  ???  Maybe something using the daily archiving feature and an include?

Brenna
btrott
Brenna's suggestion will work; it combines SSI and MT tags.

1. Turn on daily archiving.

2. In your main index template (index.html) put the following:

CODE
<!--#include virtual="archives/<MTEntries lastn="1"><$MTEntryDate format="%Y_%m_%d"$>.html</MTEntries>"-->


3. Change the output file of the main index template to index.shtml (this may not be necessary depending on how your server is configured).

That should always display the day with the most recent posts on your index.
bmk
Well I'll stick with my previous statement "I don't know what I am talking about.", but I'll change the rest to "I can't figure out the way to do it."  :p

Ben always has the answer.  :)

Brenna
SimonP
Actually, having thought about that, I guess it's equally as possible with PHP - using:

CODE
<? include($file) ?>


smile.gif

Great, thanks everyone! Most helpful smile.gif

Regards,
Simon.
bmk
Yep Simon, you got it right.. equally possible with php.

Brenna
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.