Knowledge Base / Appnel Solutions 

Last Modified
17 October 2006 @ 9pm

Getting Started with Feeds.App

Creating a Feed Widget

Displaying a Feed Using Template Tags

The Basics

The following bit of MT template markup will insert the title of the feed, wrapped in h3 tags, and output an unordered list of hyperlinked entry titles.

  • <$MTFeedInclude uri='http://feeds.feedburner.com/AppnelKBChanges' lastn='5'$>

Yes, that's it. This tag with these parameters essential create the following layout and build it.

  • <MTFeed uri='http://feeds.feedburner.com/AppnelKBChanges'>
  • <h3><$MTFeedTitle$></h3>
  • <ul><MTFeedEntries lastn=5>
  • <li><a href=<$MTFeedEntryLink$>>
  • <$MTFeedEntryTitle encode_html=1$>
  • </a></li>
  • </MTFeedEntries></ul>
  • <$MTFeedsAppVersionSlug$>
  • </MTFeed>

Multiple Feeds

THIS SHOULD COVER THE WEBLOG SETTINGS METHOD INSTEAD

Assume we have created a file, mysubs.txt, with a list of syndication feed URLs like so:

 http://feeds.feedburner.com/AppnelSolutions
 http://feeds.feedburner.com/AppnelKBChanges

To generate the last 5 entries from these feeds into a template insert this bit of markup.

  • <$MTFeedsInclude file=mysubs.txt lastn=5$>

This tag essential ouput content with the following layout:

  • <MTFeeds file=mysubs.txt type=list>
  • <h3><$MTFeedTitle$></h3>
  • <ul><MTFeedEntries lastn=5>
  • <li><a href=<$MTFeedEntryLink$>>
  • <$MTFeedEntryTitle$>
  • </a></li>
  • </MTFeedEntries></ul>
  • <$MTFeedsAppVersionSlug$>
  • </MTFeeds>

NOTE: type='list' is the default if not specified. Other valid types include 'opml' and 'csv'. See the template tag documentation for more.

Here we output the title of the feed in h3 tags and a hyperlinked unordered list of the last 5 entry titles for each feed listed in mysubs.txt.

Latest Feeds

Syndication feeds are updated at differing frequencies and intervals. If the intent of your page is to track or display the latest news or posts across a collection of feeds, the previous example will not do. The Feeds.App plugin can accomadate a last entries list with the following bit of markup.

  • <$MTFeedsLatestInclude files=mysubs.txt lastn=25 title=Latest Posts$>

Which produces output like this template:

  • <MTFeedsLatest collection=mysubs.txt type=list>
  • <h3>Latest Posts</h3>
  • <ul><MTFeedEntries lastn=25>
  • <li><a href=<$MTFeedEntryLink$>>
  • <$MTFeedEntryTitle encode_html=1$>
  • </a> [<$MTFeedEntrySourceTitle encode_html=1$>]</li>
  • </MTFeedEntries></ul>
  • </MTFeedsLatest>

Here we use a static title of Latest Posts and output the latest 25 entries from all of the feeds listed in mysubs.txt as a single unordered list of hyperlinked titles along with their source feed title in parenthesis.

These examples are only scratching the surface of the many ways and means that syndicated data can be used. See the plugin tag documentation for more options.


 

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated. Please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form.

Back to Home