Need some functionality in your templates that XMod doesn't yet provide?
Custom template tags allow add-in controls to enhance your XMod templates.
Custom Template Tags were introduced in XMod 5.0
******* Remember to check the 'Enable Custom Tag Controls' in the XMod Admin page *************
This collection includes the following tags:
TotalRatings New in v2.5.1
Parameters: Ratingslabel = string – default = “{0} vote(s)”
myXMODID = integer,
cssClass = string – css style
TotalRatings will display the total ratings count in your list or detail views.
e.g.
<fgct:TotalRatings runat="server" ratingslabel="Votes: {0} " myXMODID="<xmod:recordid/>" cssclass="normalbold" />
TotalComments Updated in v2.5.1
Parameters: commentslabel = string – now uses string.format functionality defaults to "Total Comments {0}"
{0} is replaced by comments count.,
myXMODID = integer,
cssClass = string – css style
TotalComments will display the total comments count in your list or detail views.
e.g.
<fgct:TotalComments runat="server" commentslabel="Comments: {0}" myXMODID="<xmod:recordid/>" cssclass="normalbold" />
ViewCount New in v2.5
Parameters: label = string - uses string.format default = Views {0} , 
myXMODID = integer,
update = boolean - specify if view count is incremented or not. default = false,
cssClass = string - apply a css style.
Now just like well known Articles and blog modules you can display how many times your XMod records have been viewed.
e.g. <fgct:viewcount runat="server" myxmodid="<xmod:recordid/>" label="Views: {0}" />

ShowFileIcon New in v2.3
Parameters:
filepath – specifies the location of the uploaded file
iconpath – specifies where to find the file icons. defaults to “images/filemanager” under the portal root folder.
iconext - allows you to specify what type of image files you are using, default = ".gif"
showOpenLink – determines if the icon image renders a link to the uploaded file, default = False
alttext – when showopenlink = “true” this text pre-fixes the filename that is normally displayed as the alttext. default = "click here to open "
roles – a comma delimited list of rolenames, when showopenlink = “true” the link will only be rendered when the current user is a member of one of the specified roles.
IsOnline
Parameters:UserName = string
Simply pass a username to check if that user is online (uses the standard DNN UsersOnline functionality).
If the user IsOnline then whatever content you have specified is displayed.
e.g. Display if the owner (person who added record) of a profile IsOnline.
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:isonline runat="server" username="<xmod:user type="add" field="username"/>" />
<xmod:user type="add" field="username" class="normal" /> is online!
</span>
Note: This tag simply outputs an opening <span> tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
IsNotOnline
Parameters:UserName=string
Simply pass a username to check if that user is Not online (uses the standard DNN UsersOnline functionality).
If the user IsNotOnline then whatever content you have specified is displayed.
e.g. Display if the owner (person who added record) of a profile IsNotOnline.
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:isnotonline runat="server" username="<xmod:user type="add" field="username"/>" />
<xmod:user type="add" field="username" class="normal" /> is NOT online!
</span>
Note: This tag simply outputs an opening <span> tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
IfInRoles
Parameters: UserName = string, Roles = comma delimited list of DNN role names
If the specified user is in one of the specified roles then your content is displayed.
e.g. Check if a user is a member of a particular role(s)
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:IfInRoles runat="server" username="<xmod:user type="add" field="username"/>" roles="gold,silver" />
<xmod:user type="add" field="username" class="normal" /> is in Gold or Silver Roles!
</span>
Note: This tag simply outputs an opening <span> tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
IfNotInRoles
Parameters: UserName = string, Roles = comma delimited list of DNN role names
If the specified user is Not in any of the specified roles then your content is displayed.
e.g. Check if a user is not a member of a particular role(s)
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:IfNotInRoles runat="server" username="<xmod:user type="add" field="username"/>" roles="gold,silver" />
<xmod:user type="add" field="username" class="normal" /> is NOT in Gold or Silver Roles!
</span>
Note: This tag simply outputs an opening <span>
tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
FileSize New in v2.0
New in v2.2
New parameters:
CSSClass – allows you to style the output e.g. CSSClass=”NormalBold”
Mask – allows you to specify the output format the default is "##,##0.00"
e.g. to not show any decimal places Mask="##,##0"
This tag allows you to display the filesize of any file on your portal.
Parameters: FileLocation, UnitType (either 'kb' or 'mb')
e.g.
<fgct:filesize runat="server" filelocation="staffphotos\<xmod:field name="FileUpload" usevalue="false"/>" />
1871 b
<fgct:filesize runat="server" filelocation="staffphotos\<xmod:field name="FileUpload" usevalue="false"/>" unittype="kb" />
1.83 Kb
<fgct:filesize runat="server" filelocation="staffphotos\<xmod:field name="FileUpload" usevalue="false"/>" unittype="mb" />
0.00 Mb
as the filesize output format is set at 2 decimal places when specifying the UnitType as mb then the display looks like 0 so if the filesize is under 0.50 Mb it will switch to a UnitType of Kb thus displaying 1.83 Kb.
numberChildren New in v2.0
In a parent/child application you can display the number of child records on the parent.
see Ask The Xperts for an example.
<fgct:numberChildren runat="server" commentslabel="Answers: " parentXMODID="<xmod:recordid/>" cssclass="normalbold" />
NB: this tag only works if you are using HouseKeeper for XMod to maintain the Parent/Child relationship.
displaySelectImage New in v2.0
Parameters:
myXMODID As Integer
noCols As Integer
fieldREF As String = ""
imagePath As String = ""
LiveContent As Boolean = False
This is particularly useful for listings of say properties or holiday homes etc where you have a large number of pre-defined optional attributes that you want to present in a more pleasing and space saving way.
Basically on your input form you have a <select> tag to allow the user to select which attributes apply, the value for each item is actually the filename of a corresponding image.
e.g.
You input form as the following <select> tag:
The custom tag is configured as:
Activities<br/>
<fgct:displaySelectImage runat="server" myxmodid="<xmod:recordid />" fieldREF="siteActivities" nocols="10" imagepath="siteimages/facilities/" /><br/>
The detail template displays it as:
The text value from the <select> is used as the ALT and TITLE properties of the <img> tag, so you will get the appropriate tooltip.
If you are a LiveContent user you can enable this on the tag (LiveContent="true") .
This creates a hyperlink <a> tag around each image that corresponds to the LiveContent developer mode tags.
#LiveContent[Select Tag Text value]
e.g. #LiveContent[Swimming] this uses an eContent element as a more advanced tooltip.
or
With the developer mode tag generated you are free to create anything that LiveContent allows and link it to your select image display in your template.
Another use for this tag would be to create ratings on a review form for example:
The code uses <select1> tags to create the radio button lists.
Facilities:
<select1 ref="rateFacilities" class="normal" appearance="full" required="true" repeatdirection="horizontal">
<label>Facilities</label>
<items>
<item selected="true">
<label>0</label>
<value>stars-0-0.gif</value>
</item>
<item>
<label>1</label>
<value>stars-1-0.gif</value>
</item>
<item>
<label>2</label>
<value>stars-2-0.gif</value>
</item>
<item>
<label>3</label>
<value>stars-3-0.gif</value>
</item>
<item>
<label>4</label>
<value>stars-4-0.gif</value>
</item>
<item>
<label>5</label>
<value>stars-5-0.gif</value>
</item>
</items>
</select1>
The displaySelectImage template tag is then configured as below to show the rating image for Facilities.
Ratings<br/>
<span class="normal">
<fgct:displaySelectImage runat="server" myxmodid="<xmod:recordid />" fieldREF="rateFacilities"
imagepath="siteimages/ratings/" LiveContent="false" nocols="1" selectLabel="Facilities:"/>
</span>
truncateText New in v2.1
Parameters:
myXModId As Integer
ctrlRef As String
maxLength As Integer
moreText As String = ""
stripHTML As Boolean = False
useValue As Boolean = False
Allows you to display truncated text from one of your form fields.
e.g.
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
Summary:<fgct:truncateText runat="server" myxmodid="<xmod:recordid/>" ctrlRef="notes" maxlength="100" moretext=" ..."
striphtml="true" />
The summary being displayed is the first 100 characters of the 'notes' field, shown in full lower down (with html formatting).
striphtml = true removes all the html tags from the notes field before returning the truncated text.
moretext is used to indicate that the text has been truncated, you can specify whatever text you like for this.
You can also use a ctrlRef field that has a text and a value such as a <select1> tag, useValue="true" tells the tag to return the field's value rather than the text.
Need some functionality in your templates that XMod doesn't yet provide?
Custom template tags allow add-in controls to enhance your XMod templates.
Custom Template Tags were introduced in XMod 5.0
******* Remember to check the 'Enable Custom Tag Controls' in the XMod Admin page *************
This collection includes the following tags:
TotalRatings New in v2.5.1
Parameters: Ratingslabel = string – default = “{0} vote(s)”
myXMODID = integer,
cssClass = string – css style
TotalRatings will display the total ratings count in your list or detail views.
e.g.
<fgct:TotalRatings runat="server" ratingslabel="Votes: {0} " myXMODID="<xmod:recordid/>" cssclass="normalbold" />
TotalComments Updated in v2.5.1
Parameters: commentslabel = string – now uses string.format functionality defaults to "Total Comments {0}"
{0} is replaced by comments count.,
myXMODID = integer,
cssClass = string – css style
TotalComments will display the total comments count in your list or detail views.
e.g.
<fgct:TotalComments runat="server" commentslabel="Comments: {0}" myXMODID="<xmod:recordid/>" cssclass="normalbold" />
ViewCount New in v2.5
Parameters: label = string - uses string.format default = Views {0} , 
myXMODID = integer,
update = boolean - specify if view count is incremented or not. default = false,
cssClass = string - apply a css style.
Now just like well known Articles and blog modules you can display how many times your XMod records have been viewed.
e.g. <fgct:viewcount runat="server" myxmodid="<xmod:recordid/>" label="Views: {0}" />

ShowFileIcon New in v2.3
Parameters:
filepath – specifies the location of the uploaded file
iconpath – specifies where to find the file icons. defaults to “images/filemanager” under the portal root folder.
iconext - allows you to specify what type of image files you are using, default = ".gif"
showOpenLink – determines if the icon image renders a link to the uploaded file, default = False
alttext – when showopenlink = “true” this text pre-fixes the filename that is normally displayed as the alttext. default = "click here to open "
roles – a comma delimited list of rolenames, when showopenlink = “true” the link will only be rendered when the current user is a member of one of the specified roles.
IsOnline
Parameters:UserName = string
Simply pass a username to check if that user is online (uses the standard DNN UsersOnline functionality).
If the user IsOnline then whatever content you have specified is displayed.
e.g. Display if the owner (person who added record) of a profile IsOnline.
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:isonline runat="server" username="<xmod:user type="add" field="username"/>" />
<xmod:user type="add" field="username" class="normal" /> is online!
</span>
Note: This tag simply outputs an opening <span> tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
IsNotOnline
Parameters:UserName=string
Simply pass a username to check if that user is Not online (uses the standard DNN UsersOnline functionality).
If the user IsNotOnline then whatever content you have specified is displayed.
e.g. Display if the owner (person who added record) of a profile IsNotOnline.
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:isnotonline runat="server" username="<xmod:user type="add" field="username"/>" />
<xmod:user type="add" field="username" class="normal" /> is NOT online!
</span>
Note: This tag simply outputs an opening <span> tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
IfInRoles
Parameters: UserName = string, Roles = comma delimited list of DNN role names
If the specified user is in one of the specified roles then your content is displayed.
e.g. Check if a user is a member of a particular role(s)
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:IfInRoles runat="server" username="<xmod:user type="add" field="username"/>" roles="gold,silver" />
<xmod:user type="add" field="username" class="normal" /> is in Gold or Silver Roles!
</span>
Note: This tag simply outputs an opening <span> tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
IfNotInRoles
Parameters: UserName = string, Roles = comma delimited list of DNN role names
If the specified user is Not in any of the specified roles then your content is displayed.
e.g. Check if a user is not a member of a particular role(s)
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
<fgct:IfNotInRoles runat="server" username="<xmod:user type="add" field="username"/>" roles="gold,silver" />
<xmod:user type="add" field="username" class="normal" /> is NOT in Gold or Silver Roles!
</span>
Note: This tag simply outputs an opening <span>
tag, if the result of the check is false then the tag is set not to display
you must end your content with a closing </span> tag.
FileSize New in v2.0
New in v2.2
New parameters:
CSSClass – allows you to style the output e.g. CSSClass=”NormalBold”
Mask – allows you to specify the output format the default is "##,##0.00"
e.g. to not show any decimal places Mask="##,##0"
This tag allows you to display the filesize of any file on your portal.
Parameters: FileLocation, UnitType (either 'kb' or 'mb')
e.g.
<fgct:filesize runat="server" filelocation="staffphotos\<xmod:field name="FileUpload" usevalue="false"/>" />
1871 b
<fgct:filesize runat="server" filelocation="staffphotos\<xmod:field name="FileUpload" usevalue="false"/>" unittype="kb" />
1.83 Kb
<fgct:filesize runat="server" filelocation="staffphotos\<xmod:field name="FileUpload" usevalue="false"/>" unittype="mb" />
0.00 Mb
as the filesize output format is set at 2 decimal places when specifying the UnitType as mb then the display looks like 0 so if the filesize is under 0.50 Mb it will switch to a UnitType of Kb thus displaying 1.83 Kb.
numberChildren New in v2.0
In a parent/child application you can display the number of child records on the parent.
see Ask The Xperts for an example.
<fgct:numberChildren runat="server" commentslabel="Answers: " parentXMODID="<xmod:recordid/>" cssclass="normalbold" />
NB: this tag only works if you are using HouseKeeper for XMod to maintain the Parent/Child relationship.
displaySelectImage New in v2.0
Parameters:
myXMODID As Integer
noCols As Integer
fieldREF As String = ""
imagePath As String = ""
LiveContent As Boolean = False
This is particularly useful for listings of say properties or holiday homes etc where you have a large number of pre-defined optional attributes that you want to present in a more pleasing and space saving way.
Basically on your input form you have a <select> tag to allow the user to select which attributes apply, the value for each item is actually the filename of a corresponding image.
e.g.
You input form as the following <select> tag:
The custom tag is configured as:
Activities<br/>
<fgct:displaySelectImage runat="server" myxmodid="<xmod:recordid />" fieldREF="siteActivities" nocols="10" imagepath="siteimages/facilities/" /><br/>
The detail template displays it as:
The text value from the <select> is used as the ALT and TITLE properties of the <img> tag, so you will get the appropriate tooltip.
If you are a LiveContent user you can enable this on the tag (LiveContent="true") .
This creates a hyperlink <a> tag around each image that corresponds to the LiveContent developer mode tags.
#LiveContent[Select Tag Text value]
e.g. #LiveContent[Swimming] this uses an eContent element as a more advanced tooltip.
or
With the developer mode tag generated you are free to create anything that LiveContent allows and link it to your select image display in your template.
Another use for this tag would be to create ratings on a review form for example:
The code uses <select1> tags to create the radio button lists.
Facilities:
<select1 ref="rateFacilities" class="normal" appearance="full" required="true" repeatdirection="horizontal">
<label>Facilities</label>
<items>
<item selected="true">
<label>0</label>
<value>stars-0-0.gif</value>
</item>
<item>
<label>1</label>
<value>stars-1-0.gif</value>
</item>
<item>
<label>2</label>
<value>stars-2-0.gif</value>
</item>
<item>
<label>3</label>
<value>stars-3-0.gif</value>
</item>
<item>
<label>4</label>
<value>stars-4-0.gif</value>
</item>
<item>
<label>5</label>
<value>stars-5-0.gif</value>
</item>
</items>
</select1>
The displaySelectImage template tag is then configured as below to show the rating image for Facilities.
Ratings<br/>
<span class="normal">
<fgct:displaySelectImage runat="server" myxmodid="<xmod:recordid />" fieldREF="rateFacilities"
imagepath="siteimages/ratings/" LiveContent="false" nocols="1" selectLabel="Facilities:"/>
</span>
truncateText New in v2.1
Parameters:
myXModId As Integer
ctrlRef As String
maxLength As Integer
moreText As String = ""
stripHTML As Boolean = False
useValue As Boolean = False
Allows you to display truncated text from one of your form fields.
e.g.
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
Summary:<fgct:truncateText runat="server" myxmodid="<xmod:recordid/>" ctrlRef="notes" maxlength="100" moretext=" ..."
striphtml="true" />
The summary being displayed is the first 100 characters of the 'notes' field, shown in full lower down (with html formatting).
striphtml = true removes all the html tags from the notes field before returning the truncated text.
moretext is used to indicate that the text has been truncated, you can specify whatever text you like for this.
You can also use a ctrlRef field that has a text and a value such as a <select1> tag, useValue="true" tells the tag to return the field's value rather than the text.