The Atom Syndication Format is an XML language used for web feeds. Here's an example of how to take an external Atom Feed and display the content in a dotCMS HTML Page using the XmlTool in a widget
Select **Site -> Browser** from the navigation bar and select a folder, then right click on it and click on: New –> HTML Page.
In the Add/Edit HTML Page screen enter the following information and click on Save.
In Edit Mode, click on a Body Container: Add Content button and select “Add Widget”.
A dialog box will display, select the widget type: Simple Widget on the left column and then click on “Create New Simple Widget”.
In the “Add/Edit Simple Widget” screen, enter the title: Display Content from External Atom Feed. In the code field use the following code and click on Save.
#set($myXML = $xmltool.read("http://demo.dotcms.com/home/atom-feed.html"))
#foreach($childEntry in $myXML.children().iterator())
#set($entryXML = $xmltool.parse($childEntry))
<p>
Title: $entryXML.title.text <br />
Link: $entryXML.link.text <br />
Id: $entryXML.id.text <br />
Updated: $entryXML.updated.text <br />
Summary: $entryXML.summary.text <br />
</p>
#end
- You can now preview your page by clicking on the “Preview” tab.