I am currently trying to extend the Event Calendar and having a few headaches with what I am trying to achieve.
Basically I have a new classes SportEvent and SportEventHolder.
Each sport event has a category:
static $db = array(
'Category' => "Enum('International, National, Club, Special')",
I have extended the Sport holder filter to allow filitering on this:
public function getFilterFields()
$fields = parent::getFilterFields();
$fields->addFilterField(new DropdownField('SportEvent_Category','Category', singleton('SportEvent')->dbObject('Category')->enumValues()));
Now the thing I am having trouble with is figuring out a way I can have the category filter as optional. Is there any way to add 'All' to the drop down box and effectively have it ignore the second part of the filter?
One way of trying to get around it was removing the filter and having buttons for the categories, with them linked the calendar page with ?filter=1&filter_SortEvent_Category=Club added to the end of the url, but this only works if the user selects the category and then filters on date, not the other was around.
Any ideas would be much appreaciated. As you can probably guess I am developing the website for my work. We are the governing body of a sport and are wanting to display our official calendar in a much more user friendly way than our current website.