
You will require the latest build of JEvents 1.5.4 for this plugin to work.
Install, CONFIGURE and enable the plugin. You must configure the plugin to create the required database table.
At the moment this plugin is configured via an xml file - I may (when I have the time) write a configuration component that will allow you do the configuration dynamically. Having said this the format of the XML file is quite simple.
Configuring your custom fields
1. Copy the file plugins/jevents/customfields/templates/fieldssample.xml to plugins/jevents/customfields/templates/fields.xml
2. Edit the file plugins/jevents/customfields/templates/fields.xml to create the custom fields you require. The next section describes the format of the file.
Param Tags
Each field is configured as a "param" tag. For types with no options (jevrtext, jevrtextarea and jevrboolean)
these tags are on one line and take the form
- Code:
Note that you MUST have the /> at the end of the line.
For fields with options the tags have option tags within them e.g.
- Code:
Select One
...
Field Names
You can have as many fields as you want - but they must all have a unique name (it must not start a number and have no spaces, quotation marks or other special characters). The name is only used internally so a numerically incrementing sequence like there is in the sample file is ideal (e.g. field1, field2, field3 etc.).
Field Types
The type of the field is held in the "type" attribute value. The choices are:
- Select List (choose one item from dropdown) = jevrlist
- Text Box = jevrtext
- Text Area = jevrtextarea
- Boolean (Yes/No) = jevrboolean
- Radio boxes = jevrradio
- Multiple Select List (choose one or more items from dropdown) = jevrmultilist
- Comment/Instruction Text (introduced in version 0.6) = jevrinstruction
Default Values
You can specify a default value for each field in the default attribute. This is the value that is displayed/selected when you first create/edit an event. For the jevrlist, jevrboolean, jevrradio and jevrmultilist types if the default value matches the value of one of your options that that is the option that is initially selected.
Label
The label attribute is the label that appears alongside the "input" area. This label is also used in the filter if you enable the filter in the jevents filter module.
Required/RequiredMessage
The required and requiredmessage attributes are currently not enabled but before 1.5.4 is finalised I will incorporate a javascript based required field test so that you can force event editors to complete these fields. If the field value continues to match the default value they will get a javascript alert to say which fields need to be completed - the alert message will be the value of the requiredmessage attribute.
Description
The description attribute is the tooltip that appears on top of the label when you edit an event. No quotation marks are allowed in this attribute.
Allow Override
If you specify allowoverride="0" then when you edit a repeat this custom field cannot be altered. If you specify allowoverride="1" then when you edit an event repeat this custom field can be customised for the specific repeat.
Filter
If you set filter="1" then this field will appear in the jevents filter module (if you enable the filter 'customfield' in the list of filters)
Access
You can set the reader access level for a field. 0=public, 1=registered, 2=special
Hidden Value
You can set a value for a field so that it is not displayed if this value is set. For example if you only want to show a non-default value to the site visitor. This even works with the jevrinstruction field type so that you can give your event editors instructions that are not visible to the site visitor.
Specifying Options
For jevrlist, jevrradio and jevrmultilist types you must specify options for the choices available. These follow the same format e.g.:
For jevrlist, jevrradio and jevrmultilist types you must specify options for the choices available. These follow the same format e.g.:
- Code:
Possibly
Options that are no longer valid
Over time some of your options may become out of date - e.g a price range or a conference room may no longer be available. If you set the archive attribute for an option to 1 then the field is no longer available as a choice when editing an event but will be 'translated' into human readable form when you view the event detail.
If you simply remove the option then when you view events with the out of date value the value will appear as a blank in the event detail.
Special Attributes for specific types
For the jevrtext field you can specify a size and maxlength value which controls the size of the input box and the maximum length of the allowe input.
For the jevrtextarea field you can specify the number of rows and columns for the field using the rows and cols attributes.
Filtering Your Lists/Calendar
If you wish to offer add a filter on these fields in your jevents filter module say yes to "make fields available in lists and calendar" in the plugin config and add the filter to the module using the name "customfield".
At the moment it is not possible to filter your modules and menu items based on these custom fields - let me know if this is important to you.
Don't change your custom field template
Finally - note that you can only have one set of custom fields. If you change your template file then existing custom fields from old templates will be ignored. In future releases I may make it possible to have a choice of custom field templates but this could be complex to implement and would probably have a performance impact.
Enjoy and feed back requested please