In the Forums: Showing only expired entries
This will be a regular feature where I highlight an interesting EE Forums thread and ask for your input.
Kevin Smith posted to the forums asking how you can display only the expired entries:
I need to be able to show entries that are expired, but ONLY entries that are expired. In my sidebar, I’ve got a “Current Event” link and a “Past Events” list. This is for an art gallery, and there is only one exhibition at a time, but there may be times where there isn’t an exhibition at all, so I can’t just use the offset parameter for the past events list.
Kevin was able to get it working with PHP but it’s fairly convoluted (his description). Anyone have a different approach?
Share on Twitter
Mark Bowen — 07:14 on 01.19.2009
If I’m honest I didn’t actually take a proper look at the code that was posted, was in a bit of a rush. I’m not too sure why all the weblog tags have been used there as it should have been possible (I think) to do it all with the one tag and then just use conditionals to spit out everything as has been done.
Best wishes,
Mark
Chance — 06:07 on 01.20.2009
Not exactly sure his situation is the same as mine, but I think I’ve accomplished something similar. On a museums site I am working on I had an exhibitions section that contained permanent, upcoming and past exhibitions. I displayed “permanent exhibitions” by way of a category. I had the “upcoming exhibits” display if the date the publisher sets for the entry occurred in the future, based on today’s date. And similarly, if the date the publisher had set had passed, based on today’s date, it displayed in the “past exhibitions” area. I’m sure he could create an extra custom weblog field that could contain a “Duration” number for current exhibits and use conditionals to display them.
Just a thought.