Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Admin Events Export Templates

Chris Carlevato edited this page Mar 27, 2017 · 1 revision

Helios Calendar allows admin users to create and save custom export templates. Utilizing export templates admin users can store preconfigured export formats that can be quickly and repeatedly used for the custom export of event data.

Available Templates

Templates are listed in alphabetical order by Name. Beside each template are two icons.

  • Edit Template - Click this icon to edit the template.
  • Delete Template - Click this icon to delete the template.

To add a new template click the Add Template link above the available template list.

Once you have selected the template to edit, or chosen to add a new template, you can edit the following template settings.

Template Settings

  • Name - Name of the template (used to identify the template when exporting events). Template Name should be unique and descriptive to more easily identify the template.
  • File Extension - Event data can be output directly to the browser (viewed on screen) or saved directly to a file. The file extension determines what type of file should be created when output is saved to a file.
  • Sort Order - The order to sort events by. Depending on the variables used within the template this setting may need to be adjusted.
  • Group By - In most cases this option should be set to Event, or export results will be redundant. However, by selecting from the following options templates can be specialized for a variety of uses.
  • Category - Select this option to creating a template that will use [category_unique] to output events by category.
  • Event Series - Select this option ONLY if the template uses the [date_series] variable. [date_series] variable will be NULL with all other Group By options.
  • Category & Event Series - Select this option to use [category_unique] and [date_series] to output events with date series by category.
  • Date Format - Format for event dates in the exported data. (Preview in Parentheses)
  • Long Date - Date Output Format string from Preferences.
  • Short Date - Date Input Format option from Preferences.
  • Associated Press Style - Date format set forth in the AP Style Guide.

Remove Year in AP Style

By default Helios Calendar includes the Year in event dates when using the AP Style setting. To disable this and remove year data from your export you can make the following change.

In /admin/components/TemplatesEdit.php locate the following code on or near line 77:

stampToDateAP(date("Y-m-d"),1)

and change it to:

stampToDateAP(date("Y-m-d"),0)

In /admin/components/ToolExportAction.php locate the following code on or near line 208:

stampToDateAP($row[$expVars[$i]['field']],1)

and change it to:

stampToDateAP($row[$expVars[$i]['field']],0)

This will remove the year from the exported data.

Template Variables

Each template permits the use of special text that serves as a place holder for different types of event content. When exported template variable will be replaced within the output by the event data exported from Helios Calendar.

Special Use Variables

  • |N - (Pipe character, capital N) Force Line Break

Event Detail Variables

  • [event_id] - Unique ID for the event. Assigned by Helios Calendar when the event is added or submitted.
  • [event_title] - The event title.
  • [event_desc] - The event description. Including all HTML and JavaScript tags. For cleaned event description (text only, no tags) please use [desc_notags] variable.
  • [event_date] - The date of the event.
  • [event_time_start] - The event start time.
  • [event_time_end] - The event end time.
  • [event_cost] - The event cost.
  • [event_billboard] - Event billboard status (1 for billboard events, 0 for regular events).

Event Contact Variables

  • [contact_name] - Name of event contact.
  • [contact_email] - Email address of event contact.
  • [contact_phone] - Telephone number of event contact.
  • [contact_url] - Website address (URL) of event contact.

Registration Variables

  • [space] - Registration limit for event.

Location Variables

  • [loc_name] - Name of the location.
  • [loc_address] - Address of the location.
  • [loc_address2] - Address “line 2” of the location. (Suite, Office, PO Box, etc).
  • [loc_city] - City of the location.
  • [loc_region] - Region of the location. (State, Province, etc)
  • [loc_postal] - Postal code of the location. (“Zip Code”)
  • [loc_country] - Country of the location.
  • [loc_url] - Website address (URL) of the location.

Note: Saved Location data takes precedent.

Condition Variables

  • [date_series] - The first and last date of the event series (for recurring events).
  • [date_unique] - Exports event date only when it changes in the results set (for exporting events by date).
  • [category_unique] - Exports event category only when it changes in the results set (for exporting events by category).
  • [desc_notags] - “Filtered” event description. Tags, HTML & JavaScript source removed.

Note: The use of these variables, with exception to [desc_notags] , is dependent on template settings detailed above.

Header & Footer Variables

  • [cal_url] - Website address (URL) of your public Helios Calendar site (CalRoot global).

Template Structure

A template consists of three distinct sections.

Header

The beginning section of the template will be added once to the start of the exported data. The header is optional and can be used as needed.

Content Section

The content section makes up the bulk of the export output. This portion of the template is populated with exported event data.

Footer

The final section of the template will be added once to the end of the exported data. The footer is optional and can be used as needed.

Template Examples

Helios Calendar includes the following sample templates by default:

  • InDesign - Two samples (By Category & By Date) for a custom InDesign even data import.
  • Quark - For a custom Quark event data import.
  • CSV All Variables - Exports event data using all available template variables in CSV format.
  • CSV Import Format - Exports event data matching Helios' required CSV input format.
  • XML File - An example of one possible XML file creation via event export.

While these templates by no means represent the full capabilities of the export system they do provide an excellent starting point to sample the variety of export types possible.

Automated Clean Up

All events are not created equal. Because events can contain varying amounts of data, and the template is merely a framework for export, Helios Calendar includes an optional clean up process to remove unwanted content from the completed export. This clean up is performed based on the template's preset clean up entries.

After completing the export Helios compares clean up entries to the export it has built. The export has all occurrences of the clean up entries removed before it is output to the user's browser or download file. This cleanup process helps to minimize the “massaging” required in order to make the export work correctly with whatever process, software, script, etc that the export is destined for.

Note: The clean up process performs matches exactly, and is case sensitive, so all potential cases should be included in the clean up section of the template.

Clean Up Example

Null, invalid or otherwise empty data fields are exported as “BLANK” (without quotes). To remove this “blank” data from the export all new templates are created with “BLANK” (without quotes) as a default clean up entry. By exporting empty data fields as BLANK Helios Calendar allows for the clean up any custom formatting from the export.

Note: Clean up entries must each be entered on a new line within the template edit form. Entries are case sensitive and blank export values are always explicitly “BLANK” (without quotes).

Ex) This example references a sample template included with Helios Calendar.

If our template content is:

|N
##[date_unique]|N
##[category_unique]|N
[event_title]. [event_time_start]. [loc_name], [loc_address], [loc_city]. [desc_notags] [contact_url] [event_cost]

and we want to ensure that any blank category and date lines were removed from the export, and a blank line isn't forced, we would add:

##BLANK|N

Likewise we can also ensure that any blank Title, Start Time, Location Name or Location City data did not result in stray periods or comas in the exported data by adding:

BLANK,
BLANK.

By preceding these entries with a space we can also ensure the proper space between fields for each export record is maintained. Finally, we can ensure that any blank Descriptions, Contact URLs or Cost fields were filtered by adding:

BLANK

By customizing the clean up entries for your unique templates you can ensure a more streamlined export process.

Clone this wiki locally