Use an Article and a Foreach loop in a Template to insert all the entries from an RSS feed into a Template.
To include all RSS Feed entries
First, create an Article to call the RSS Feed Reference Tags:
- Go to CONTENT > VIEW TEMPLATES to view the list of templates.
- Click Add Article to open the Add Article page.
- Enter the Article Name and Description.
- For the Body, add the RSS Feed Entry Tags you wish to display. See the examples below.
- Click CREATE to save the Article.
Next, create a Template and Define the RSS Feed and call the Article:
- Click Go to CONTENT > VIEW TEMPLATES to view the list of templates.
- Click Create new template to open the Add Template page.
- Enter a Name and Subject.
- Click the format tab in which you wish to include the feed: Plain Text, HTML, Mobile.
- In the Template area, add the RSS Feed Definition Tag:
%%rssfeed url=[URL] name=[NAME]%%
where [URL] is the URL to access the RSS feed, [NAME] is the identifier within your content.
- Add a foreach tag to call the Article in which the feed is referenced:
%%foreach "[NAME]" article "[ARTICLE_NAME]" type=rss%%
where [NAME] is the identifier within your content and [ARTICLE_NAME] is the article in which the RSS Feed References are defined.
- Click CREATE to save the Template.
Plain Text Example
Article Name: RSSDisplay_plain
Article Description: RSS Display Plain
Article Body:
%%$rss_title.striphtml%%
%%$rss_link%%
%%$rss_pubdate%%
%%$rss_description.striphtml%%
Template RSS Tag Call:
%%rssfeed url=http:// mydomain.com/rss/feed name=myfeed_PT%%
%%foreach "myfeed_PT" article "RSSDisplay_plain" type=rss%%
HTML Example
Article Name: RSSDisplay_HTML
Article Description: RSS Display HTML
Article Body:
<p><a href="%%$rss_link%%"><b>%%$rss_title%%</b></a><br />
%%$rss_pubdate%%<br />
%%$rss_description%%<br />
%%$rss_content%%</p>
<img src="%%$rss_mediaimage%%" width="250px" /></p>*
Template RSS Tag Call:
%%rssfeed url=http:// mydomain.com/rss/feed name=myfeed%%
%%foreach "myfeed" article "RSSDisplay_html" type=rss%%
*Image support added in v11.9.0