You are here:   Modules > Advanced Articles > Demo - Articles Archive
Register   |  Login

Advanced Articles Satellite

Minimize
Tokens Replace Reference for Event Calendar & Registration Module v3.0
7/12/2009 5:04:00 AM by Invenmanager
Tokens Replace Reference for Event Calendar & Registration Module v3.0

This module supports token replace class. This is very powerful because users are able to completely customize their own different view from the available data.

Token Replace allows the following notations:
[Object :Property]
[Object :Property|Format]
[Object :Property|Format|IfEmpyReplacement]

The output can be formatted using a format string. You can use the usual Date and Time Format Strings for date values or Numeric Format Strings for any numeric value. String values are handled using String.Format.

Example:
[User:Lastname|Dear Mr./Mrs . {0}] will render: Dear Mr./Mrs. Walker
[Date:Now|dddd] will render: Monday
[Date:Now|MM/dd/yyyy] will render: 09/22/2008

The “Format" string can be followed by an additional “IfEmptyReplacement" which will be returned when is requested property is not found or not set.
Example: [User:Firstname|Hi {0}|Hello Guest]
Example: [STARTDATE|HH] will render the hour of the event start date in 24 hour format.

The following Tokens can be used for the Template for this module:

[EDIT] This will render an edit pencil, if, and only if, the logged on user had edit rights for the module. You MUST add this token to the Item Template (and alternate item template if you are using that), in order to be able to edit items
[ITEMID] This will render the item id of the event
[MODULEID]

This will render the module id of the module the event belongs to

[CREATEDBYUSERNAME] This will display the display name of the user that created the event.
[CREATEDBYUSER] This will display the UserID of the user who created the event.
[CREATEDDATE] This will show the item creation date, in localized long date format.
[DESCRIPTION] This will display the announcement discription
[PICTURE] This will display the image provided for the event. A complete image tag will be rendered.
Example: <img src="/Portals/22/myimage.gif">
[PICTURESRC] This will display the image provided for the event. Only the image raw source will be rendered. For example: "~/portals/0/images/sample.gif"
[READMORE] This will render the "more..." text with hyperlink to the event detail page.
[READMORELINK] This will render the raw hyperlink to the event detail page. Example to use this tag:
Your Text
[REGISTER] This will render "Register" text with hyperlink to Events Registration page. This will be displayed when the event is set to allow Registration.
[REGISTERLINK] This will render the raw hyperlink to Events Registration page. Example to use this tag:
Your Text
[EXPORTTODESKTOP] This will render the text and hyperlink to allow user to export the event to a cvs calendar file to their desktop such as Outlook Calendar.
[RETURN] This will render a hyper link back to the Events Calendar page.
[VENUE] This will render the event venue.
[EVENTDATE] This will show the event date and time, in localized long date format. Example: 25 March 2008 13:30 ?15:00. For All-day event, only date is displayed.
[STARTTIME] This will render the event start time, in localized short time string format. If it is All-Day-Event, nothing will be displayed. Example: 15:30.
[ENDTIME] This will render the event end time, in localized short time string format. If it is All-Day-Event, nothing will be displayed. Example: 15:30.
[STARTDATE] This will render the event start date. You can use custom formatting for such tokens, such as [STARTDATE|MM/dd/yyyy], will render 09/18/2008
[ENDDATE] This will render the event end date. You can use custom formatting for such tokens, such as [ENDDATE|MM/dd/yyyy], will render 09/18/2008
[TITLE] This will display the event title.
[DESCRIPTION] This will render the description of the event. If a text length limit is set at the Settings page, then the content may be trimmed to the max length specified at the Settings page. This is usually useful for a list view, to show a short description instead of the entire content.
[FULLDESCRIPTION] This is the same as [DESCRIPTION], except it renders the complete description of the event. It is usually used in the Detail Template.
[ATTACHMENTURL] This will show the attachment with hyperlink to the document.
[ATTACHMENTURL2] This will show the second attachment with hyperlink to the document
[ALLOWREGISTRATION] This will show whether this event allow registration or not, in Yes or No format.
[CATEGORY] This will render the Category ID for this event.
[CATEGORYNAME] Render all the categories the current event belongs to.
[FEES] Renders the fees for that event. Empty if it is a free event.
[VENUEDETAILLINK] Renders the URL to display the venue detail.
[EMAIL] Renders the email associated with this event.
[REGSTARTDATE] Renders the date from which the registration for the event is opened. Nothing if there is no such date is specified.
[REGENDDATE] Renders the date from which the registration for the event is closed.
[CUSTOM1] Renders the value for the custom field 1
[CUSTOM2] Renders the value for the custom field 2
[CUSTOM3] Renders the value for the custom field 3
[CUSTOM4] Renders the value for the custom field 4
[CUSTOM5] Renders the value for the custom field 5
[NUMBEROFPARTICIPANTS] Renders the number of participants registered for the event, if a user registers the event and choose 5 attendees, 5 participants will be added for calculation.
[AVAILABLESEATS] Renders the number of seats available, this is equivalent to [MAXREGISTRATION] - [NUMBEROFPARTICIPANTS]
[MAXREGISTRATION] The maximum participants allowed for this event, if 0 is specified, then no limit.
[RECURRINGIMAGE] This renders image for recurring event only.
[CATEGORYCOLOR] Add this token to render the first category detected for the event, based on the color code saved for that category. This is used usually when single category is used.
Sample for the Calendar View, event link template:
[TITLE]
[DAYVIEWLINK] Renders the link to the day view of the event start date.
[GOOGLEMAPLINK] Renders the Google maps link to the event venue.
[CALENDARSTARTDATE] This renders the event start date as a small calendar in which the month is displayed on top of the date. You can format the display using the stylesheet.
[MAPLINK] If the map link for the venue is provided at the Manage Venue page, then the map url will be displayed, otherwise, it renders the Google maps link to the event venue.
[TABID] It renders the current TabID on which the event calendar resides.
[TABMODULEID] It renders the TabModuleID of the current event calendar module.
[REGONCEPERUSER] It renders in a native Boolean format for whether this event is configured to allow Registration Per User or not.
[CUSTOMxxx]
where xxx is the custom property name
This renders the value of the custom fields entered for the event. The format to render custom properties will be [CUSTOMPROPERTYNAME] For example, if you created a custom property named as BirthDate, the format to display this will be [CUSTOMBIRTHDATE]

You can format the text the way you want it, for example, [STARTTIME:hh] will render the hour only.

By default, TokenReplace recognizes the following Object names as valid source for values. These are general information about your portal and current user. A list of tokens available for this module is also listed below.

Object Class / Data source Default Content
“Host”  System.Collection.Hashtable Secure Hostsettings
“Portal” DotNetNuke.Entities.Portals.PortalSettings current PortalSettings
“Tab” DotNetNuke.Entities.Tabs.TabInfo current TabInfo
“Module” DotNetNuke.Entities.Modules.ModuleInfo Nothing
“Culture” System.Globalization.CultureInfo currrent Culture
“User” DotNetNuke.Entities.Users.UserInfo current User
“Profile” DotNetNuke.Entities.Profile current User.Profile
“Membership” DotNetNuke.Entities.Users.Membership current User.Membership