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:
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:
Example:
[Blog:Title|Featured Posts in {0}] will render: Featured Posts in DemoBlog
Available Tokens for author object:
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.