Buck Anderson posted on July 30, 2009 10:40 :: 2062 Views

The Custom Template Tag collection includes the following tags:
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.
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.
This functionallity would be very useful in a forum or private messaging application built with XMod.
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)
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)
This functionallity would be very useful if you would like to show a specific subset of template content only to a certain security role group.
TotalComments
Parameters: commentslabel = string, myXMODID = integer
TotalComments will display the total comments count in your list or detail views.
Extremely useful to show the number of comments on a list view template.
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.
This adds greater credibility to your ratings.
ViewCount New in v2.5
Parameters: label = string - uses string.format default = Views {0} , image
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}" />
The abilty to show view count can be extremley important on an application like DNN professor's Business Directory application where you are selling directory listing subscriptions and the subscriber needs to know how many times their listing has been viewed.
Here is how I modify the Business Directory templates to show view count.
- Install the control according to the documentation that is included from FatGeorge.
- Next, I edit my List View template using the Xmod Plain Text editor.

The code looks like this:
<xmod:register tagprefix="fgct" namespace="fatgeorge.CustomTags" assembly="fatgeorge.CustomTemplateTags" />
- Finally, I add the additional line of code to reveal the view count on the list view template.
<fgct:viewcount runat="server" myXMODID="<xmod:recordid/>" label="Views: {0}" cssclass="dnnpSmall" />
- If I am using the Xmod separate detail module with my detail template, I add the same code to the detail view template.
- Save your template. Done!
The result can be viewed here.
Find more information on the FatGeorge Custom Template Tags Add-on for XMod here.
Enjoy,
Buck