Starting with SunBlogNuke version 3.6.0, the blogging module full supports for dnn core token replace functionality that allows you to use replacement tokens inside your template of widgets like Content Slider Widget. This new feature provides a MUCH needed enhancement to the Ultimate DNN Blog Module - SunBlogNuke. You will find it very helpful and very powerful because you are able to completely customize their own different view from the available data. Today I am taking the time here to give you a brief overview of this awesome function.

What is Token Replace in DNN?

Standard 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.

Please visit the useful tutorial about the similar token replacement feature in Text/HTML module.

The available Tokens in the SunBlogNuke

The following Tokens can be used for the Template in the Content Slider Widget:

  • [PORTAL:PORTALID] - portal id (Identity);
  • [BLOG:TITLE] - the name of the blog where this post published;
  • [POSTID] - post id (Identity);
  • [LINK] - the link to the actual post in detail;
  • [TITLE] - the title of the post;
  • [EXCERPT] - the excerpt of the post;
  • [EXCERPT|XXX] - the excerpt of the post restricted by number of characters, e.g. replace XXX with 50 to restrict to 50 chars. 150 characters in default;
  • [EXCERPTTEXT] - the plaintext for post excerpt (strip out HTML tags and script, escape any quote or escape characters);
  • [EXCERPTTEXT|XXX] - the plaintext for post excerpt (strip out HTML tags and script, escape any quote or escape characters) and restricted by number of characters, e.g. replace XXX with 50 to restrict to 50 chars. 150 characters in default;
  • [ENTRY] - the post content;
  • [ENTRYTEXT] - the plaintext for the post content (strip the HTML except line breaks and paragraphs);
  • [ENTRYTEXT|XXX] - the plaintext for the post content (strip the HTML except line breaks and paragraphs) and restricted by number of characters, e.g. replace XXX with 50 to restrict to 50 chars. 1024 characters in default;
  • [CATEGORIES] - comma delimited list of categories hyperlinked;
  • [TAGS] - comma delimited list of tags hyperlinked;
  • [THUMBNAIL] - thumbnail url;
  • [ADDEDDATE] - the created date of the post;
  • [ADDEDDATE|XXX] - the created date of the post, the XXX can be replaced with a date format expression;
  • [DATETIMEAGO] - the timeago format for the created date;
  • [AUTHOR] - the name of the post author;
  • [AUTHOR:USERID] - the author id (Identity);
  • [AUTHOR:AVATARURL] - the avatar url of the post author;
  • [VIEWCOUNT] - the view count of the post;
  • [COMMENTCOUNT] - the comment count of the post;
  • [customfields:xxx] - xxx is the key of custom fields.

Example:
[TITLE] will render the current post like: Tokens Replace Reference for SunBlogNuke
[EXCERPTTEXT|255] will render plaintext for post excerpt with limited 255 characters, and in default the value is 150.

It also recognizes the following Object names as valid source for values except for the basic entry properties. These are general information about your portal, current blog and current author. A list of tokens available for this module is also listed below.

Object Class / Data source Default Content
"Portal" DotNetNuke.Entities.Portals.PortalSettings current PortalSettings
"Blog" SunBlogNuke.Entities.BlogInfo the blog context for current post
"Author" SunBlogNuke.Entities.BlogUserInfo the author of current post

Available Tokens for blog object:

  • [BLOGID] - blog id(Identity);
  • [TITLE] - blog name;
  • [DESCRIPTION] - summary for the blog;
  • [LINK] - link redirected to landing(home) page of the blog;
  • [RSSLINK] - rss feed source for the blog;

Example:
[Blog:Title|Featured Posts in {0}] will render: Featured Posts in DemoBlog

Available Tokens for author object:

  • [PORTALID] - portal id (Identity);
  • [LINK] - the link to view all the posted published by that author;
  • [FRIENDLYLINK] - like the [LINK] token but built with nickname for friendly url;
  • [RSSLINK] - Rss feed source for the author;
  • [USERID] - author id (Identity);
  • [AUTHOR] - author nickname;
  • [AVATARURL] - the author avatar url;
  • [ENTRYCOUNT] - the count of the posts published by the author;
  • [BIO] - the biography of the author;

Example:
[Author:Nickname|Posted by {0}] will render: Posted by Baldwin
[Author:AvatarUrl|36] will render avatar with a specific size value – 36, means width 36px & height 36px, and in default the size value is 50.

PS: updated with SunBlogNuke v4.2.5.