Hi,
I noticed that people are interested in how to add a field like "location" to the event form at backend so I created my first extension.
Description
This extension adds additional text field "Location", "Participants" and "Contact" to an event at backend, saved data can be outputted at frontend. At backend all fields are available at search menu, so events can be found via location, participants or contact. As well all fields are available at User groups > Allowed fields > tl_calendar_events to grant or deny access.
Instructions
Copy this syntax into a frontend template for displaying events:
Module type: Calendar (cal_default.*)
- <?php echo $event['cep_location']; ?>[/*:m:1scoc62j]
- <?php echo $event['cep_participants']; ?>[/*:m:1scoc62j]
- <?php echo $event['cep_contact']; ?>[/*:m:1scoc62j]
Module type: Event reader, Event list (event_full.*, event_list.*, event_teaser.*, event_upcoming.*)
- <?php echo $this->cep_location; ?>[/*:m:1scoc62j]
- <?php echo $this->cep_participants; ?>[/*:m:1scoc62j]
- <?php echo $this->cep_contact; ?>[/*:m:1scoc62j]
Default Values
The fields at backend can have default values, that means new events have already such a value; the default values can be changed or deleted if necessary. To use default values please copy the following syntax into file /system/config/dcaconfig.php
- $GLOBALS['TL_DCA']['tl_calendar_events']['fields']['cep_location']['default'] = 'Custom value';[/*:m:1scoc62j]
- $GLOBALS['TL_DCA']['tl_calendar_events']['fields']['cep_participants']['default'] = 'Custom value';[/*:m:1scoc62j]
- $GLOBALS['TL_DCA']['tl_calendar_events']['fields']['cep_contact']['default'] = 'Custom value';[/*:m:1scoc62j]
This extension can be found at Contao Extension Repository:
http://www.contao.org/en/extension-list ... _plus.html
I would be happy to get your feedback here.
Changelog:
17.08.2010
Released version 1.0.0 stable.
10.09.2010, Version 1.1.0
Added additional field "Contact".
05.01.2012
Tested and released for Contao 2.10.4
22.04.2012
Tested and released for Contao 2.11.2
Bookmarks