I was wondering if anybody out there has some xslt code that will read an rss feed with audio files like the following. http://thesaltminechurch.podbean.com/feed/ I have been researching but can't seem to come up with anything.
You could use the the runwayfeedviewer to learn how to read in rss feeds and display content how you like I did this just now. as a quick butcher/hack job to see what I could get working take a look: http://www.cssandstuff.com/quicktest?alttemplate=audiofeed
install runway and have a look through runwayfeedviewer.xslt
I was wondering if there was a way to install just the feed viewer xslt rather than the whole project. Or if there is a place where I can grab the code for the feed viewer.
<!-- start writing XSLT --> <xsl:choose> <xsl:when test="$feed != ''"> <xsl:variable name="feedContent" select="umbraco.library:GetXmlDocumentByUrl($feed, number($cacheRate))"/> <xsl:choose> <xsl:when test="$feedContent != 'error'"> <xsl:call-template name="renderFeed"> <xsl:with-param name="feedContent" select="$feedContent"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <p> <strong>Feed Viewer Macro Error: Error fetching feed</strong><br /> The feed '<xsl:value-of select="$feed"/>' could not be loaded. Verify that the feed url exists and that you have an active internet connection </p> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <p> <strong>Feed Viewer Macro Error: No feed chosen</strong><br /> Please make sure to add a value in the "Feed Url" parameter </p> </xsl:otherwise> </xsl:choose> </xsl:template>
<!-- start writing XSLT --> <xsl:choose> <xsl:when test="$feed != ''"> <xsl:variable name="feedContent" select="umbraco.library:GetXmlDocumentByUrl($feed, number($cacheRate))"/> <xsl:choose> <xsl:when test="$feedContent != 'error'"> <xsl:call-template name="renderFeed"> <xsl:with-param name="feedContent" select="$feedContent"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <p> <strong>Feed Viewer Macro Error: Error fetching feed</strong><br /> The feed '<xsl:value-of select="$feed"/>' could not be loaded. Verify that the feed url exists and that you have an active internet connection </p> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <p> <strong>Feed Viewer Macro Error: No feed chosen</strong><br /> Please make sure to add a value in the "Feed Url" parameter </p> </xsl:otherwise> </xsl:choose> </xsl:template>
Thanks for your fast response. I copy the code above for the test example you used. I had to place the url in the feedUrl but when i go to render it gives the error "Feed Viewer Macro Error: No feed chosen Please make sure to add a value in the "Feed Url" parameter." Is there a certain way that the url should be placed in beside this way.
Yes,I went a bit crazy with my copy and pasting.... they were both the same code (have updated now though)
you shouldn't get rid of the variable paramaters directly like I did in my quicktest.... I was just short on time.
if you copy the 2nd lot of xslt from my previous post > create a new xslt and make sure the 'create macro' is also checked when you do it. then take a look at the associated macro (which will have the same name as what you gave your xslt) > click on the paremeters tab and create the following parameters
Then when you insert your macro into a template you'll be asked for the feedurl, number of items and excerpt length which you can enter so that your xslt can do it's job.
Failing that, install runway.... you can always remove it again after you're done looking under the hood.
Reading Rss with Xslt
I was wondering if anybody out there has some xslt code that will read an rss feed with audio files like the following. http://thesaltminechurch.podbean.com/feed/ I have been researching but can't seem to come up with anything.
You could use the the runwayfeedviewer to learn how to read in rss feeds and display content how you like
I did this just now. as a quick butcher/hack job to see what I could get working
take a look: http://www.cssandstuff.com/quicktest?alttemplate=audiofeed
install runway and have a look through runwayfeedviewer.xslt
- Tim
Last FM for umbraco would probably give you a pretty good test case for what you're trying to acheive also
http://our.umbraco.org/projects/website-utilities/lastfm-for-umbraco
umbraco.library:GetXmlDocumentByUrl should be able to read in the RSS feed. With that you could create a macro that has two parameters:
This XSLT should then parse out the MP3 links:
Forgot to mention that you would also need to include the macro on the template you wanted to render to.
Tim,
I was wondering if there was a way to install just the feed viewer xslt rather than the whole project. Or if there is a place where I can grab the code for the feed viewer.
here's the one I hacked for the quicktest example:
and here's the original from runway
Tim,
Thanks for your fast response. I copy the code above for the test example you used. I had to place the url in the feedUrl but when i go to render it gives the error "Feed Viewer Macro Error: No feed chosen Please make sure to add a value in the "Feed Url" parameter." Is there a certain way that the url should be placed in beside this way.
<xsl:variable name="feed" select="/macro/www.thesaltminechurch.podbean.com/feed"/>
Yes,I went a bit crazy with my copy and pasting.... they were both the same code (have updated now though)
you shouldn't get rid of the variable paramaters directly like I did in my quicktest.... I was just short on time.
if you copy the 2nd lot of xslt from my previous post > create a new xslt and make sure the 'create macro' is also checked when you do it.
then take a look at the associated macro (which will have the same name as what you gave your xslt) > click on the paremeters tab and create the following parameters
Then when you insert your macro into a template you'll be asked for the feedurl, number of items and excerpt length which you can enter so that your xslt can do it's job.
Failing that, install runway.... you can always remove it again after you're done looking under the hood.
is working on a reply...