In the New Event Registration page, Event field gets all the events from very beginning. How can I configure to display only the upcoming events.
2 Answers
Don't think there is a setting in the UI to do this. The event is basically added to the input widget using the getlist
api of Event
entity. Adding the following param to the same should be able to list only upcoming events in the input field.
'params' => array('start_date' => array('>' => "now")),
You should be able to do this via an extension. Or if you want to see the param buildup in core, it is present in Event/Form/Participant.php
Extending the above array to include our param should remove the past events.
$eventFieldParams['api']['params']['start_date'] = array('>' => "now");
Note that changes made to core would be lost after an upgrade, so it is better to override this file in an extension OR see if any hook can help you in attaining this.
-
It works. Thank you. For now I added this in Participant.php. Later will do the same via extension or hook. Thanks again. Feb 22, 2018 at 12:12
You can set the Event Is_active Flag to FALSE - you can find this in Event Configure Page
Is this Event Active?
So, the list will ignore any in-active event Events.
I guess this helps!!!