I was getting a bit irritated having to enable PHP and get the current time to use the start_on and show_future_entries feature of the weblogs tag.
I have created a plug-in that avoids all of that. Mind you, I had to use an un-documented feature to get it to work.
I call it AroundNow. Here is an example of its use:
{exp:weblog:entries weblog="events start_on="{exp:aroundnow goback='12'}" parse="inward" show_future_entries="yes" sort="asc"}
{title}
{/exp:weblog:entries}
There is one parameter: goback - so:
goback='12'
will start the events listing from 12 hours ago. This is just in case you want to keep the event ‘alive’ for at least part of a day.
I am dropping it here in case it might be of use to anyone. Make sure you put the hours in single quotes and remember to use show_future_entries=”yes”.
I have only tested on EE version 1.52
CJ
If you don’t need the “goback” parameter, you don’t have to use PHP to provide the current time to start_on=, you just need the latest version of ExpressionEngine and use the {current_time} variable.
current_time is a cool thing, but what I really need is current_time at 12:01am. 😊
Edit:
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.