I am building an event-section and need only to publish the future events. Any clue on how to accomplish this?
Something in the likes of
Best regards
Reported on Movable Type 4.3
I am building an event-section and need only to publish the future events. Any clue on how to accomplish this?
Something in the likes of
Best regards
Reported on Movable Type 4.3
I'd just give them a tage like "Future" and select them as usual. Then you can just remove the tag as it passes.
Thanks for the suggestion, it is a useful one, but not in practice. Especially not if a lot of events are added everyday.
This should work but appears to be evaluating the length of the strings instead of the value of the numbers created by formatting the dates; since all posts show up when you use lt="thecurrentdate" and none show up when you use gt="thecurrentdate", but the dates output as expected...
Let me know if you figure out the answer! Very interested! ^_^
Upcoming Events as of <mt:entries><$mt:Date format="%Y%m%d" $><br/>
<mt:setvarblock name="theentrydate"><$mt:EntryDate format="%Y%m%d" $></mt:setvarblock>
<mt:setvarblock name="thecurrentdate"><$mt:Date format="%Y%m%d" $></mt:setvarblock>
<$mt:Var name="theentrydate"$> -EntryDates vs. CurrentDate- <$mt:Var name="thecurrentdate"$>
<mt:if name="theentrydate" gt="thecurrentdate" >
<$mt:entrydate$><$mt:entrytitle$><br/>
</mt:if>
</mt:entries>
oops, forgot you need to include the trim and strip_linefeeds as follows:
That's actually a real clever suggestion. Am gonna try it. Tnx!
hm, the only problem is you never know how many entries you'll get. Something like is useless in this case. Guess I'll have to hack it myself to find out to create a modifier like future="1" or something.
But thanks!
I tried to write 'something like <mt:entries limit="10"/>', but mt stripped my tag
usually you use limit with sort by an lastn without sort by:
(which will pull most recent entries, not sure if it's by publish date or the editable authored_on date)^_^
True, but still: you wouldn't know how many of those last 10 will meet the criteria of being in the future. It might be none, or it might be 10, or it might be a value in between. So if you want to have at least 10 items on your page, this way it's not gonna work...
Also: if you want to display 10 items on your page and you have 20 items in the future and you sort on date, then you will miss the first 10 items in the future...
It was a real clever idea, but not sufficient for what I need :)
I want to do something similar and the old DateTags from Staggernation aren't working for me. So I found that Beau Smith published this snippet on his site:
http://www.beausmith.com/mt/2009/05/publish-only-entries-with-dates-the-future-or-past.php
But when I add 'category="categoryname" ' to the mt:Entries tag, it breaks it completely and shows all entries. Any ideas why?
I found a little bug in the 'days' attribute of mt:entries that makes it possible to easily select only future entries:
http://www.movabletips.com/2011/02/how-to-publish-only-future-entries-in-movable-type.html