How does Low Events control an entry’s visibility?
Hi Low,
I know the title of this topic seems like a completely naive question, however, I’m a little worried that I am either completely missing the point or I’ve done something wrong.
Both could be true.
So the crux of my question is, does Low Events still depend on ExpressionEngine’s native Entry and Expiration Date to control its visibility.
I have just built this website http://www.cornexchangenew.com/ and I’ve noticed that the What’s on Today panel on the home page, doesn’t behave itself.
If an entry does not have an expiration date, the event is still visible.
As soon as I add an expiration date and include the show_expired="no" show_future_entries="yes" parameters it disappears. So, am I right in thinking that the show_passed="no" show_active="no" is not really having any effect in this scenario?
Here are the parameters I am using:
{exp:low_events:entries
channel="event"
disable="member_data|trackbacks|category_fields|pagination"
status="open"
dynamic="no"
show_expired="no"
show_future_entries="yes"
sticky="no"
date="{current_time format="%Y-%m-%d"}"
show_passed="no"
show_active="no"
unit="day"
events_field="cf-event-date"
orderby="cf-event-date"
sort="asc"
}
I also noticed that if the entry date was set differently (in the future) to the Low Events start date, then this was used to control the entries visibility.
I’m sorry if this is a slightly annoying question. It’s been a hard build, a difficult launch and a long day.
Thanks,
Simon
Replies
Low 20 Nov 2012 21:04
No worries, Simon.
With Low Events, an entry's Entry Date and Expiration Date only affect when the entry is published on the site, much like an entry's status. Using the native show_future_entries and show_expired parameters apply to the native Entry and Expiration dates.
When you use the low_events:entries tag, entries are sorted by event start date by default: this is the date you enter in the Low Events field. Everything is calculated with the dates entered in the custom field in mind. So, the parameters show_passed, show_active and show_upcoming all check the dates given in the custom fields, not the native Entry and Expiration dates.
Take this example: There's an event starting on December 5th. You enter it today (November 20th), but set the Entry Date to December 1st. As long as show_future_entries isn't "yes", the event will not be listed before December 1st.
Looks like you could simplify your example code to this:
Which will show all upcoming events for today only.
Looking at the parameters left out:
- Status is "open" by default
- Dynamic is set to "no" by default by Low Events
- show_expired is "no" by default
- show_future_entries can be "no" (the default), because only events with an event start date of today will be shown
- sticky is "no" by default (and actually not really supported with Low Events yet)
- If no date="" param is given, today is assumed
- If there's only one Low Events field in the event channel, no need to set is as a param
- orderby is set to the event's start date by default
- that includes in ascending order
I hope that clarifies things a bit.
thoughtful_web 21 Nov 2012 11:16
Hi Low,
Thanks for your quick and informative reply.
It’s good to know that low_events:entries tag is completely independent from ExpressionEngine’s native entry/expiration date. I assumed this was likely to be the case, but when you find yourself scratching your head you tend to grasp at straws.
In fact, removing the superfluous parameters helped put me on the path to discover what was creating all the erratic behaviour.
The website I built is for a UK theatre, however, their website is hosted on a server in the States.
As Low Events uses PHP date to calculate the date info, it was always -8 hours behind.
This became even more evident when the highlighted today cell in the mini calendar was still showing yesterday’s date at midnight.
I rectified the issue by setting the timezone within EE’s config.php file to be local using:
Obviously, I’d prefer the server to be in the UK but this is unfortunately out of my control.
I’m guessing this issue may affect others, so I was wondering if this is something you could add to your website/installation notes or perhaps accommodate within the config of the add-on?
Thanks for your help.
Simon