Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hello, quick question on a small point a client has raised ... he is setting up new events for the coming season of concerts for his music festival and doesn't want to release them to public view until April 1st. He has set the page status to unpublished.

The events template displays k_page_date for the event date and also uses k_page_date to determine whether to display ticketing info (if the event date is in the past - the event is an archived event and ticketing info is not appropriate so isn't displayed). Because the unpublished date is set to 1st January 1970 the draft he views doesn't show ticketing info for him to check out.

Is there something I can do about this or is this just how it works?
Hi,

An unpublished page actually has its date set (in database) to 0000-00-00 00:00:00.
Anyways, that doesn't change the problem you mention - the logic you placed will still consider it 'past'.

I think, instead of unpublishing a yet 'unreleased' event, we can try setting its publish date (temporarily) to a set future period - say 10 years from now.
The cms:pages tag used to list the events then can be made to skip all such future events by using the 'stop_before' parameter e.g.
Code: Select all
<cms:pages masterpage='events.php' show_future_entries='1' stop_before='2023-01-01'>
..
</cms:pages>

This way the all such events will not get listed on the front-end and yet will allow all actions that you'd expect to be possible with a published page.

Do you think this proposed solution helps?
Adding to my previous reply -
Coming to think a little more about it, there can be several other solutions that won't require fudging the publish-date (or unpublishing the page). Here are a couple of them -
1. You can create a folder, say named 'Unreleased', and place such events in them. The cms:pages tag can be made to skip all pages of this folder.
2. You can create a custom radio-button editable region that can be used to mark the unreleased events. The cms:pages 'custom_field' parameter can be used to skip marked pages.
I like the radio button solution - thanks KK. I am wondering if for a similar situation on a future site if I would be better not to use k_page_date as the event date, but to set up an editable region for that, leaving k_page_date to function as a behind the scenes data item.
Using an editable region to hold the event's date will work, nevertheless I feel using the publish-date as the event's date has its own merits.
Apart from being 'semantically' correct, using the system field allows 'archiving' the events (archive-view) something which won't be possible with custom field.

IMHO, it'd be better to use radio-buttons or a checkbox to simply mark if the event should be listed on the front-end or not.
5 posts Page 1 of 1