x
 
Create New Page
 View Previous Changes    ( Last updated by slim )

Feed Enclosures Plugin

Using Feed Enclosures Plugin for RSS feed to podcast an audio file

This is one way to use the Feed Enclosures Plugin to create an RSS feed to podcast an audio file.

In the Default Field Group for a weblog called ‘news’ create a custom field called ‘audioplayer’.

When posting an item in the ‘news’ blog, the ‘audioplayer’ field contains the name of an associated mp3 file. In this example there is a folder at the webroot called ‘podcasts’ containing the audio files.

NOTE: make sure the file name has NO spaces, otherwise the enclosure will not appear in the RSS feed.

The RSS template should look like this:

{exp:rss:feed weblog="news"}

<?xml version
="1.0" encoding="{encoding}"?>
<rss version="2.0"
    
xmlns:dc="http://purl.org/dc/elements/1.1/"
    
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    
xmlns:admin="http://webns.net/mvcb/"
    
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    
xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <
channel>
    
    <
title>{exp:xml_encode}{weblog_name}{/exp:xml_encode}</title>
    <
link>{weblog_url}</link>
    <
description>{weblog_description}</description>
    <
dc:language>{weblog_language}</dc:language>
    <
dc:creator>{email}</dc:creator>
    <
dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <
dc:date>{gmt_date format="%Y-%m-&#xd;T;%H:%i:%s%Q"}</dc:date>
    <
admin:generatorAgent rdf:resource="http://www.pmachine.com/" />
    
{exp:weblog:entries weblog="news" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks"}
    
<item>
      <
title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
      <
link>{exp:xml_encode}{title_permalink=templategroupname/index}{/exp:xml_encode}</link>
      <
description>{exp:xml_encode}{summary}{/exp:xml_encode}</description>
      <
dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
      <
content:encoded><![CDATA[{body}]]></content:encoded>
      <
dc:date>{gmt_entry_date format="%Y-%m-&#xd;T;%H:%i:%s%Q"}</dc:date>
{if audioplayer}{exp:feed_enclosures}<a rel="enclosure" href="http://www.mywebsite.com/podcasts/{audioplayer}">{audioplayer}</a>{/exp:feed_enclosures} {/if}
    
</item>
{/exp:weblog:entries}
    
    
</channel>
</
rss>

{/exp:rss:feed}

The RSS feed will now contain the 10 latest posts from the ‘news’ webblog with the mp3 enclosure where one is included in an individual post.

Category:RSS
Category:Podcasting

Categories: