Skip to content

RSS Widget Markup Syntax

The RSS Markup syntax uses the Handlebars template syntax. 

The markup can be modified from within the RSS Widget "edit markup" tab. The variables that can be used in the markup are below. 

Available Variables


The variables below 

Feed

title

The feed title

description

The feed description

imageUrl

The URL to the feed's image

lastUpdatedAt

The date & time at which the feed was last updated

url

The URL to which the feed belongs

authorName

The name of the author (only available in ATOM feeds)

authorURL

The URL of the author (only available in ATOM feeds)


Feed Entries

entries

Is an array of the entries that are available to be used

For each element of this array, the following variables are available:

title

The entry's title

entryId

The entry's unique ID (GUID/ID/URI)

author

The entry's author

url

The url to the original entry

escapedUrl

The url to the original entry, url encoded

publishedAt

The date & time at which the entry was published. If published date is not available, then last updated date is used.

content

The entry's content

contentText

The entry's content without HTML tags. 
A maximum number of characters to display can be optionally added using the attribute: max-chars. e.g. {{contentText max-chars="200"}}

firstContentImageURL

The URL of the first image that appears in the entry's content. 
Images can be filtered for size using two attributes: min-width (default 100 pixels), and min-height (no default). e.g. {{firstContentImageURL min-width="200" min-height="50"}} 
Images can be cropped using crop-width and crop-height. e.g. {{firstContentImageURL crop-width="50" crop-height="40"}} Width is required if you wish to crop the image. 
You may combine filtering and cropping.

Other Variables

additionalStoriesExist

Evaluates true or false depending on whether there are additional stories in the feed not displayed in the widget; use to conditionally display content when there are or are not additional stories

additionalStoryCount

The number of additional stories in the feed not displayed in the widget

Examples

Simple Example


The below example is a fairly simple example of a markup that displays the RSS feed title, feed Updated at, as well as the Title, cropped image, published at, author, title and 200 characters of the content for each entry. 
e.g. 
            <p>RSS TITLE: <a href="{{url}}" class="rss-details-title-link">{{title}}</a></p>
            <p>Updated At: {{lastUpdatedAt}}</p>
            <p>&nbsp;</p>
        
            {{#each entries}}
                <p>Title: <a href="{{url}}" target="_blank">{{title}}</a></p>
                <p>Image: <a href="{{url}}" target="_blank"><img src="{{firstContentImageURL crop-width="175" crop-height="131"}}" style="width:100%; height:auto;" border="0" /></a></p>
                <p>publishedAt: {{publishedAt}}</p>
                <p>author: {{author}}</p>
                <p>content (200 characters): {{contentText max-chars="200"}}</p>
            {{/each}}

Conditional Example


The below example expands the simple example by conditionally displaying the author name. If the author exists, it will be outputted, else there "no author" will be outputted. See Handlebars Conditional reference for more examples additional conditional helpers.
e.g. 
            <p>RSS TITLE: <a href="{{url}}" class="rss-details-title-link">{{title}}</a></p>
            <p>Updated At: {{lastUpdatedAt}}</p>
            <p>&nbsp;</p>
        
            {{#each entries}}
                <p>Title: <a href="{{url}}" target="_blank">{{title}}</a></p>
                <p>Image: <a href="{{url}}" target="_blank"><img src="{{firstContentImageURL crop-width="175" crop-height="131"}}" style="width:100%; height:auto;" border="0" /></a></p>
                <p>publishedAt: {{publishedAt}}</p>
                {{#if author}}
                   <p>author: {{author}}</p>
                {{else}}
                   <p>author: no author</p>
                {{/if}}
                <p>content (200 characters): {{contentText max-chars="200"}}</p>
            {{/each}}


Feedback and Knowledge Base