Using Your Own Feeds
You don't have to use public Atom feeds, you can create your own. The collection field provides you with a simple standards-based means of integrating data from other systems into your Escenic publications. All you have to do is generate a correctly-formatted Atom feed in which:
-
The
title
element of eachentry
contains the label that you want to appear in the field. -
Some other element of each feed contains the data item you want to store in the field.
Here, for example, is a very simple feed:
<?xml version="1.0"?> <feed xmlns="http://www.w3.org/2005/Atom"> <author> <name>my-site.com</name> </author> <id>http://my-host/my/first/feed</id> <link rel="self" href="http://my-host/my-first-atom-feed" type="application/atom+xml"/> <updated>2012-07-26T12:34:25.323Z</updated> <title type="text">My first feed</title> <entry> <id>http://my-host/my/first/entry</id> <title type="text">One</title> <content type="text">1</content> <summary type="text">The first</summary> <updated>2012-07-26T12:34:25.323Z</updated> </entry> <entry> <id>http://my-host/my/second/entry</id> <title type="text">Two</title> <content type="text">2</content> <summary type="text">The second</summary> <updated>2012-07-26T12:34:25.323Z</updated> </entry> <entry> <id>http://my-host/my/third/entry</id> <title type="text">Three</title> <content type="text">3</content> <summary type="text">The Third</summary> <updated>2012-07-26T12:34:25.323Z</updated> </entry> </feed>
If this is referenced by the following collection field definition:
<field name="feedTest" type="collection" src="http://my-host/my-first-atom-feed" select="content" mime-type="text/plain"> <ui:label>My first feed</ui:label> </field>
then Content Studio users will be able to choose between the display
values "One", "Two" and "Three" when filling in the field. Selecting
"One" will cause the value 1
to be stored in the
field.
You can retrieve this field's value in your publication templates as follows:
${article.fields.feedTest.value}