Register  |  Login
  Information > DNN Blog
DotNetNuke Blog

Current Articles | Categories | Search | Syndication

Events: Templating

One thing the team has spent a lot of time on over the last months is the templating of the Events module. This is by no means all encompassing, but does allow templating of various elements of the module, including:-

  • Detail View - most elements are templateable, but excludes the reminder fields, enrollment fields and the new enrollee list
  • New Event Description
  • Tooltips
  • Emails
    • Enrollment - and there are a lot more of them now
    • Moderation
    • Reminders
    • New Event notification
  • Date columns in List and Day view - In these instances, the template is the format string to be applied to the date.

It should be noted that only a subset of these tokens are available for Reminders. The current list for reminders is Title, Start/End date, Time Zone, Description, Category, Location, Custom Field 1, Custom Field 2, Created By/Date, Owned By, Last Updated By/Date. This is because this process is run via the schedule and doesn't have access to quite the same set of information as the main module.

The following shows the current default template for the detail view. The template in this case needs to be a set of html which can be inserted into the page in it's entirety. There are three types of token in here:-

  1. [event:title] - Which is replaced by the relevant text from event
  2. [NOTALLDAYEVENT][event:startdate][/NOTALLDAYEVENT] - Which is used to indicate a set of html which be included or not based on event or module settings
  3. [BREAK] - Only used on the detail page, to indicate where the Reminder/Enrollment/Enrollee List should be placed on the page. See bottom of this page for more details.

 

<table cellspacing="2" cellpadding="3" border="0" width="90%" style="text-align:left">
<tbody>
<tr valign="top">
<td class="SubHead">
<span class="Head">[event:title]</span> [event:eventimage]
</td>
</tr>
</tbody>
</table>
[BREAK]
[BREAK]
<table cellspacing="2" cellpadding="3" border="0" width="90%" style="text-align:left">
<tbody>
<tr valign="top">
<td class="SubHead" style="width:35%">
<span class="SubHead">[event:startdatelabel]</span>
</td>
<td>
<span class="Normal">[NOTALLDAYEVENT][event:startdate][/NOTALLDAYEVENT][ALLDAYEVENT][event:startdate|D][/ALLDAYEVENT]</span>
<span class="Normal">[event:timezone]</span>
</td>
</tr>
[DISPLAYENDDATE]
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:enddatelabel]</span>
</td>
<td>
<span class="Normal">[NOTALLDAYEVENT][event:enddate][/NOTALLDAYEVENT][ALLDAYEVENT][event:enddate|D][/ALLDAYEVENT]</span>
<span class="Normal">[event:timezone]</span>
</td>
</tr>
[/DISPLAYENDDATE]
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:recurringlabel]</span>
</td>
<td>
<span class="Normal">[event:recurring]</span>
</td>
</tr>
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:importancelabel]</span>
</td>
<td>
<span class="Normal">[event:importance]</span>
</td>
</tr>
[DISPLAYCUSTOMFIELD1]
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:customfield1label]</span>
</td>
<td>
<span class="Normal">[event:customfield1]</span>
</td>
</tr>
[/DISPLAYCUSTOMFIELD1]
[DISPLAYCUSTOMFIELD2]
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:customfield2label]</span>
</td>
<td>
<span class="Normal">[event:customfield2]</span>
</td>
</tr>
[/DISPLAYCUSTOMFIELD2]
[IFHASCATEGORY]
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:categorylabel]</span>
</td>
<td>
<span class="Normal">[event:category]</span>
</td>
</tr>
[/IFHASCATEGORY]
[IFHASLOCATION]
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:locationlabel]</span>
</td>
<td>
<span class="Normal">[event:location]</span>
</td>
</tr>
[/IFHASLOCATION]
<tr valign="top">
<td class="SubHead">
<span class="SubHead">[event:descriptionlabel]</span>
</td>
<td>
<div class="Normal">[event:description]</div>
</td>
</tr>
</tbody>
</table>
[BREAK]
<table cellspacing="2" cellpadding="3" border="0" width="90%" style="text-align:left">
<tbody>
<tr valign="top">
<td class="Normal">
[event:createdbylabel] [event:createdby] [event:createddatelabel] [event:createddate]
</td>
</tr>
</tbody>
</table>

Below is a list of the Tokens currently available.

Template help

Tokenname Description
[event:title] Event title and the sub calendar modulename when defined in settings
[event:eventimage] Image when one is associated with the event
[event:startdatelabel] Label defined for start date in the resource file
[event:startdate|format] Start date formatted (optional) by the format string *
[event:enddatelabel] Label defined for end date in the resource file
[event:enddate|format] End date formatted (optional) by the format string *
[event:timezone] Timezone description
[event:importancelabel] Label defined for importance in the resource file
[event:importance] Importance with icon (for low and high importance)
[event:descriptionlabel] Label defined for description in the resource file
[event:description] Description defined in the event
[event:categorylabel] Label defined for category in the resource file
[event:category] Category associated with the event
[event:locationlabel] Label defined for location in the resource file
[event:location] Location associated with the event
[event:recurringlabel] Label defined for recurrance in the resource file
[event:recurring] Recurrence defined in the event
[event:customfield1label] Label defined for custom field 1 in the resource file
[event:customfield1] Custom field 1 defined in the event
[event:customfield2label] Label defined for custom field 2 in the resource file
[event:customfield2] Custom field 2 defined in the event
[event:customfield3label] Label defined for custom field 3 in the resource file
[event:customfield3] Custom field 3 defined in the event
[event:titleurl] URL to the event
[event:signupusername] Name of user enrolled to an event
[event:createdbylabel] Label defined for created by in the resource file
[event:createdby] Name of user the event was Created By
[event:createddatelabel] Label defined for created date in the resource file
[event:createddate] Date the event was created
[event:ownedbylabel] Label defined for owned by in the resource file
[event:ownedby] Name of user the event is Owned By
[event:lastupdatedbylabel] Label defined for last updated by in the resource file
[event:lastupdatedby] Name of user the event was Last Updated By
[event:lastupdateddatelabel] Label defined for last updated date in the resource file
[event:lastupdateddate] Date the event was last updated

Other Tokens

The following tokens can be used to alter what is displayed based on options stored in the database:-

Token Description Example
ALLDAYEVENT Includes the text specified within the token if the event is an All Day Event. [ALLDAYEVENT][event:startdate|D][/ALLDAYEVENT]
NOTALLDAYEVENT Includes the text specified within the token if the event is not an All Day Event. [NOTALLDAYEVENT][event:startdate][/NOTALLDAYEVENT]
DISPLAYENDDATE Includes the text specified within the token if Display End Date is selected. [DISPLAYENDDATE][event:enddate][/DISPLAYENDDATE]
DISPLAYCUSTOMFIELD1 Includes the text specified within the token if Custom Field 1 is enabled. [DISPLAYCUSTOMFIELD1][event:customfield1][/DISPLAYCUSTOMFIELD1]
DISPLAYCUSTOMFIELD2 Includes the text specified within the token if Custom Field 2 is enabled. [DISPLAYCUSTOMFIELD2][event:customfield1][/DISPLAYCUSTOMFIELD2]
IFHASCATEGORY Includes the text specified within the token if the vent has been assigned to a Category. [IFHASCATEGORY][event:category][/IFHASCATEGORY]
IFHASLOCATION Includes the text specified within the token if the vent has been assigned to a Location. [IFHASLOCATION][event:location][/IFHASLOCATION]

Limited Use Tokens

The following tokens has specific limited uses:-

Token Description
BREAK  The token [BREAK] is used within the Detail View to denote where the template should break to display the following elements which are not tokenised:-
  1. Reminder controls
  2. Enrollment controls
  3. List of Enrollees
This token can only be used three times. Any text placed before the first [BREAK] appears above all three elements. Any text after the third appears below the list of Enrollees, and above the control buttons.

posted @ 09 January 2009 14:45 by Roger Selwyn

Previous Page | Next Page

COMMENTS

Name (required)

Email (required)

Website

CAPTCHA image
Enter the code shown above: