RSS Merge Tags

The tags are generally divided into two groups. Feed Level and Item Level. Feed Level deals with the elements that are under the <channel> element. Item Level deal with each <item> in the <channel>. 

 The following is an example of putting it all together:

 [RSSFeed url=”http://www.kpho.com/list/216452/kpho-newstream?clienttype=rss” [^]]

<div>

  <h1>[RSSFeedLink text=”[RSSFeedTitle]” style=”color: white;”]</h1>

  [RSSItems]

  <table border=”1″ width=”100%”>

    <tbody>

      <tr>

        <td>

          <div style=”text-align: left;”>[RSSItemEnclosure format=”image” width=”100″ align=”left” hspace=”5″ vspace=”5″ border=”0″ linked=”true”]</div>

          <div style=”text-align: left;”> </div>

          <div>[RSSItemLink style=”color: white;”]</div>

          <p style=”font-size: 10pt; padding: 0; margin: 0;”>[RSSItemDescription max-word-count=”10″] [RSSItemLink text=”Read More >>” style=”color: white;”]< /p >

          <p style=”font-size: 10pt; padding: 0; margin: 0;”><span style=”color: yellow;”>[RSSItemCreator]</span>< /p >

          <p style=”font-size: 10pt; padding: 0; margin: 0;”><span style=”color: #99cc00;”>[RSSItemPubDate pattern=”MMM d, yyyy”]</span>< /p >

        </td>

      </tr>

    </tbody>

  </table>

  [/RSSItems]

</div>

[/RSSFeed]

· Feed Level RSS Merge Tags

[RSSFeed][/RSSFeed]

description:  This is the main set of tags. Note that this requires an end tag. The tags delineate the beginning and end of the dynamic content. All other RSS tags that occur in between are related to the specified feed. The feed is specified by the required URL attribute.

attributes:

1.url – Required. Specifies the URL of the feed.

2.encoding – Optional. Defaults to UTF-8. Defines the character set to use when retrieving the feed. Common values are “ISO-8859-1” and “UTF-8”.

example

[RSSFeed url=”http://www.kpho.com/list/216452/kpho-newstream?clienttype=rss”] … [/RSSFeed]

[RSSFeedTitle] 

related RSS element:   <title> within <channel>

description:   Outputs the content of the feed’s <title> element.

Attributes:

1.default  – Optional. Default is blank. If there is no <title> element, then this value will be output.

2.format  – Optional. Default is blank, which outputs the title as-is. Set to “text” to strip any HTML formatting from the title and only output the plain text. 

Exexample

[RSSFeedTitle]

[RSSFeedTitle format=”text”]

[RSSFeedLink]

Related RSS element:  <link> within <channel>

Description:  Outputs an <a> element with the href set to the URL found within the feed’s <link> element.  The target is always set to “_blank”. 

Attributes:

1.default  – Optional.  Default is blank.  If there is no <link> element, then this value will be used as the URL.

2.text  – Optional.  Default is “[RSSFeedTitle]”.  Defines the text to display for the link, i.e. the content between the start <a> and end </a>.

3.*other* – Optional.  Any other attributes are appended as attributes of the <a> element that is produced.  This is particularly useful for providing inline styling on the <a> element via a style attribute. 

Example: 

[RSSFeedLink]

[RSSFeedLink text=”View Feed as Web Page” style=”color: white; text-decoration: none;”]

[RSSFeedDescription]

Related RSS element:  <description> within <channel>

Description:  Outputs the content of the feed’s <description> element. 

Attributes:

1.default  – Optional.  Default is blank.  If there is no <description> element, then this value will be output.

2.text  – Optional.  Default is blank, which outputs the description as-is.  Set to “text” to strip any HTML formatting from the description and only output the plain text.

3.max-word-count  – Optional.  Default is unlimited.  After this many words, the output will be truncated followed by an ellipsis.  Any non-positive value will be treated as unlimited.

4.line-break  – Optional.  Default is blank, which outputs the line breaks as-is.  Can be “break”, “breakbreak”, or “paragraph”.  This attribute specifies what to use as replacements for line breaks found in the description.  The “break” value will replace each line break with a single break element, i.e. < br >.  The “breakbreak” value will replace each line break with two break elements, i.e. < br >< br >.  The “paragraph” value will replace each line break with a paragraph element, i.e. < p >.

Example:

[RSSFeedDescription]

[RSSFeedDescription format=”text” max-word-count=”50″]

[RSSFeedElement]

Related RSS element:  Any element within <channel>

Description:  Outputs the content of the specified RSS element or its attribute.  Use the name attribute to specify the name of the element or attribute.

Attributes:

1.name  – Required.  Specifies the name of the element within the <channel> element to output.  To output an attribute value ofthe element, then append an @ followed by the attribute name.

2.default  – Optional.  Default is blank.  If the specified element is not present, then this value will be output.

3.format  – Optional.  Default is blank, which outputs the element as-is.  Set to “text” to strip any HTML formatting from the element and only output the plain text.

4.line-break  – Optional.  Default is blank, which outputs the line breaks as-is.  Can be “break”, “breakbreak”, or “paragraph”.  This attribute specifies what to use as replacements for line breaks found in the element.  The “break” value will replace each line break with a single break element, i.e. < br >.  The “breakbreak” value will replace each line break with two break elements, i.e. < br >< br >.  The “paragraph” value will replace each line break with a paragraph element, i.e. < p >.

Example: 

[RSSFeedElement name=”copyright”]
[RSSFeedElement name=”atom:link@href” default=”http://www.example.com”] 

[RSSItems][/RSSItems]

Related RSS element:  <item> within <channel>

Description:  Iterates across each of the <item> elements, outputting the content between the start and end tag for each item. Note that this requires an end tag.  RSS item tags that occur between the start and end tags will be applied for each item. Items can be optionally filtered so that only items that match the filtering conditions will be included.  When filtered, then the items are numbered based on their position within the matched items, not within the entire item list.  This has an impact on this tag’s start attribute, or the RSSItemConditional tag’s position attribute.  Filtering requires all 3 filter attributes.

Attributes:

1.start  – Optional.  Default is 1.  Indicates which item to start iterating from.  

2.count  – Optional.  Default is unlimited.  Indicates how many items (including the starting item) to output.  If there aren’t enough items, then only as many items as are present will be output.

3.filter-element  – Optional.  Specifies the name of the element within the <item> element to filter against.  To use an attribute value of the element, then append an @ followed by the attribute name.

4.filter-comparison  – Optional. Can be “contains”, “not-contains”, “exact”, “not-exact”, “starts”, “ends”, “pattern”, “not-pattern”.  The comparisons are not case-sensitive.  The “not-” prefix negates the comparison result.

5.filter-value  – Optional.  The value to compare to the element (or attribute) value.  If the comparison is “pattern” or “not-pattern”, you can use wildcards — use * for any string, ? for any character, \ to escape the literals *?\ .

Examples:   

[RSSItems]< p >[RSSItemLink]< /p >[/RSSItems]
[RSSItems start=”4″]< p >[RSSItemLink]< p >[/RSSItems]
[RSSItems count=”3″]< p >[RSSItemLink]< p >[/RSSItems]
[RSSItems start=”4″ count=”3″]< p >[RSSItemLink]< p >[/RSSItems]
[RSSItems filter-element=”title” filter-comparison=”exact” filter-value=”Today’s Forecast” count=”1″]< p >[RSSItemDescription]< /p>[/RSSItems]

·Item Level RSS Merge Tags

[RSSItemTitle]

Related RSS element:  <title> within <item>

Description:  Outputs the content of the item’s <title> element.

Attributes:

1.default  – Optional.  Default is blank.  If there is no <title> element, then this value will be output.

2.format – Optional.  Default is blank, which outputs the title as-is.  Set to “text” to strip any HTML formatting from the title and only output the plain text. 

Examples:   

[RSSItemTitle]
[RSSItemTitle format=”text”]

[RSSItemLink]

Related RSS element:  <link> within <item> 

Description:  Outputs an <a> element with the href set to the URL found within the item’s <link> element.  The target is always set to “_blank”. 

Attributes:

1.default  – Optional.  Default is blank.  If there is no <link> element, then this value will be used as the URL.

2.text – Optional.  Default is “[RSSItemTitle]”.  Defines the text to display for the link, i.e. the content between the start <a> and end </a>.

3.*other* – Optional.  Any other attributes are appended as attributes of the <a> element that is produced.  This is particularly useful for providing inline styling on the <a> element via a style attribute.

Examples:

[RSSItemLink]
[RSSItemLink text=”View Article as Web Page” style=”color: white; text-decoration: none;”]

[RSSItemDescription] 

Related RSS element:  <description> within <channel>  

Description:  Outputs the content of the item’s <description> element. 

Attributes:

1.default  – Optional.  Default is blank.  If there is no <description> element, then this value will be output.

2.format – Optional.  Default is blank, which outputs the description as-is.  Set to “text” to strip any HTML formatting from the description and only output the plain text.

3.max-word-count – Optional.  Default is unlimited.  After this many words, the output will be truncated followed by an ellipsis.  Any non-positive value will be treated as unlimited.

4.line-break – Optional.  Default is blank, which outputs the line breaks as-is.  Can be “break”, “breakbreak”, or “paragraph”.  This attribute specifies what to use as replacements for line breaks found in the description.  The “break” value will replace each line break with a single break element, i.e. < br >.  The “breakbreak” value will replace each line break with two break elements, i.e. < br >< br >.  The “paragraph” value will replace each line break with a paragraph element, i.e. < p >.

Examples:

[RSSItemDescription]
[RSSItemDescription format=”text” max-word-count=”50″]

[RSSItemCreator]

Related RSS element:  <dc:creator> within <item>

Description:  Outputs the content of the item’s <dc:creator> element.  If there are multiple <dc:creator> elements, then they will be output together, each separated by the separator attribute value (a comma and space by default).  

Attributes:

1.default  – Optional.  Default is blank.  If there is no <dc:creator> element, then this value will be output. 

2.format – Optional.  Default is blank, which outputs the description as-is.  Set to “text” to strip any HTML formatting from the description and only output the plain text.

3.separator – Optional. Default is a comma followed by a space.  This will be output between each creator if there are multiple creators.  If there are fewer than two creators, then this separator will not be output. 

Examples:

[RSSItemCreator]
[RSSItemCreator format=”text” default=”Unknown Author” separator=” / “]

[RSSItemPubDate]

Related RSS element:  <pubDate> within <item> 

Description:  Outputs the item’s publication date, optionally reformatting the date using a different pattern.  The publication date is expected to be in the format “EEE, d MMM yyyy HH:mm:ss z”.  For example, “Tue, 1 Dec 2015 14:32:00 EST”.   

Attributes:

1.default  – Optional.  Default is blank.  If there is no <pubDate> element, then this value will be output. 

2.pattern – Optional.  Default is blank, which outputs the publication date as-is.  The syntax to use for date patterns can be found at http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html . 

Examples:

[RSSItemPubDate]
[RSSItemPubDate pattern=”MM/dd/yyyy” default=”Today”]

[RSSItemContent] 

Related RSS element:  <content:encoded> within <item>  

Description:   Outputs the content of the RSS <content:encoded> element.

Attributes:

1.default  –  Optional.  Default is blank.  If there is no <content:encoded> element, then this value will be output. 

2.pattern – Optional.  Default is blank, which outputs the content as-is.  Set to “text” to strip any HTML formatting from the content and only output the plain text.

3.max-word-count – Optional.  Default is unlimited.  After this many words, the output will be truncated followed by an ellipsis.  Any non-positive value will be treated as unlimited.

4.line-break – Optional.  Default is blank, which outputs the line breaks as-is.  Can be “break”, “breakbreak”, or “paragraph”.  This attribute specifies what to use as replacements for line breaks found in the content.  The “break” value will replace each line break with a single break element, i.e. < br >.  The “breakbreak” value will replace each line break with two break elements, i.e. < br >< br >.  The “paragraph” value will replace each line break with a paragraph element, i.e. < p >.

5.

Examples:

[RSSItemContent]
[RSSItemContent format=”text” max-word-count=”50″]

[RSSItemEnclosure] 

Related RSS element:  <enclosure> within <item>   

Description:   Outputs the enclosure, either as an image, a linked image, or a link.  For images, if neither the width nor height attribute are provided, then the images native dimensions will be used.  If either one of width or height are provided, then the image’s native proportions will be used to determine the missing dimension

Attributes:

1.default  –  Optional.  Default is blank.  If there is no <enclosure> element, then this URL will be used.  

2.format – Optional.  Default is “image” if the enclosure’s type attribute has a MIME type that starts with “image/”, otherwise the default is “link”.

3.linked – Optional.  When the format is “image”, then this will wrap the image in an <a> element to make it linked to the image URL as well.

4.text – Optional.  Default is the URL’s filename, or “Enclosure” if the URL has no filename.  When the format is “link”, this defines the text to display for the link, i.e. the content between the start <a> and end </a>.  This does not apply to linked images.

5.*other* – Optional.  Any other attributes are appended as attributes of the <a> or <img> element that is produced.  This is useful for providing a style attribute for the link.  For images, some notable attributes are height, width, align, alt, border, hspace, and vspace.

Examples:

[RSSItemEnclosure] 
[RSSItemEnclosure format=”image” width=”100px” align=”left” hspace=”5″ vspace=”5″ border=”0″ alt=”Photograph” linked=”true”]
[RSSItemEnclosure format=”link” text=”View Attachment” style=”color: white; text-decoration: none;”]

[RSSItemConditional][/RSSItemConditional]  

Description:    These tags allow for conditional content to be either included or excluded based on the current item’s position in the RSSItems group.  Note that this requires an end tag.  The tags delineate the beginning and end of the conditional content.  The conditional content can include other RSS tags.

Attributes:

1.position – Required.  Indicates the item position to test for.  If this is a number, then only the item in the specified position (with the first item being position 1) will be matched.  This attribute also accepts certain special values: “first”, “last”, “odd”, or “even”.

2.action – Optional.  Default is “include”.  Indicates what to do with the conditional content if the position matches.  Can be set to either “include” or “exclude”.

Examples:

[RSSItemConditional position=”first”] Include for first item only [/RSSItemConditional]
[RSSItemConditional action=”include” position=”2″] Include for second item only [/RSSItemConditional]
[RSSItemConditional action=”exclude” position=”last”] Anything but the last item [/RSSItemConditional]

[RSSItemElement] 

Related RSS element:  Any element within <item>

Description:   Outputs the content of the specified RSS element or its attribute.  Use the name attribute to specify the name of the element or attribute. 

Attributes:

1.name –  Required.  Specifies the name of the element within the <channel> element to output.  To output an attribute value of the element, then append an @ followed by the attribute name.

2.default– Optional.  Default is blank.  If the specified element is not present, then this value will be output. 

3.format – Optional.  Default is blank, which outputs the element as-is.  Set to “text” to strip any HTML formatting from the element and only output the plain text. 

4.line-break – Optional.  Default is blank, which outputs the line breaks as-is.  Can be “break”, “breakbreak”, or “paragraph”.  This attribute specifies what to use as replacements for line breaks found in the element.  The “break” value will replace each line break with a single break element, i.e. < br >.  The “breakbreak” value will replace each line break with two break elements, i.e. < br >< br >.  The “paragraph” value will replace each line break with a paragraph element, i.e. < p > . 

Examples:

[RSSItemElement name=”source”]

[RSSItemElement name=”source@href” default=”http://www.example.com”

Was this article helpful?

Related Articles