Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsRSS Feed not showing picturesRSS Feed not showing pictures
Previous
 
Next
New Post
3/15/2007 12:57 PM
 

weediddy, I guess the point was not clear enough. In order for you to successfully transform any rss feed, you need to know what kind of feed is being referenced. You can do that by examining the source of the feed, which is simple using IE7, place the url in the address and browse to it. Then, right click and choose 'View Source'. Now, looking at the example feed in the original post. We have the most important info we need at our disposal. Briefly, the first thing I look at, includes what version of RSS we are being fed, and what namespaces are being used.

<rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

The highlighted line from that feed tells us that it is rss version 2.0 and that it's using a special namespace from feedburner.  This information is important if you want to display every tag refererenced in the feed.  The current version of DNN News Feeds (RSS) by default only supports RSSv0.91 feeds, and uses a default xsl file to do the transformation.  This very basic xsl does not allow translation of HTMl in any of the tags within a feed.

Now, given you have an RSS v2.0 feed using feedburner extension tags, you have to do some extra work to get the feed to display as expected.   Each feed is going to be a little different, so your approach to using a newsfeed has to include understanding RSS, and XSL, otherwise you will not get the look and feel you desire. 

Specifically, the post asked about how to get pictures to display from the feed.  In this case, you need a way to allow HTML to show up, as the default xsl does not allow HTML.  Given that this feed has embedded the pictures in the description content, you need to allow for that type of use.  Most often, you can get HTML to display by modifying the tag in question to include the instruction to allow it.  Here's the basic tag modified to allow HTML content:

<xsl:value-of select="title" disable-output-escaping="yes"/>

Now, to extend the example to work for this specific feed, you need to look at the various tags within the feed to see what else you need to do or want to do with it.  Make the appropriate changes in your xsl and test it.  There are no shortcuts to the learning curve, and the post I gave you includes some warnings about allowing feeds with HTML on a public site.  There are some dangers.

So, to make a long story short, here's an example xsl you can use to get a start.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- RSSv2.0 Simple XSL Example by Phil 'iwonder' Guerra -->
<xsl:template match="/">
 <div>
  <xsl:apply-templates select="rss/channel"/>
  </div>
</xsl:template>
<xsl:template match="rss/channel">
<xsl:variable name="link" select="link"/>
  <xsl:variable name="description" select="description"/>
  <xsl:variable name="image" select="image/url"/>
  <xsl:variable name="idesc" select="image/description"/>
  <xsl:variable name="ilink" select="image/link"/>
  <xsl:variable name="iwide" select="image/width"/>
  <xsl:variable name="ihigh" select="image/height"/>

<div class="head">
 <xsl:if test="$image">
 <a href="{$ilink}" title="{$idesc}"><xsl:value-of select="ilink" /></a>
 <img src="{$image}" height="{$ihigh}" width="{$iwide}" style="float: left; margin: 2px; border: 0px;"/>
 </xsl:if>
 <font size="-2"><xsl:value-of select="description"/><br/>
     <a href="{$link}"><xsl:value-of select="title" /></a><br/>
 <xsl:value-of select="webMaster"/><br/>
 <xsl:value-of select="copyright"/></font>
 <hr/>
</div>

 <xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
 <xsl:variable name="item_link" select="link"/>
 <xsl:variable name="item_title" select="description"/>
 <div class="subHead">
  <a href="{$item_link}"><xsl:value-of select="title" disable-output-escaping="yes"/></a></div>
 <font size="-2">
 <xsl:value-of select="description" disable-output-escaping="yes"/></font><br/>
 <font size="-3">
 (<xsl:value-of select="pubDate"/>)</font><br/> <hr/>
 </xsl:template>
</xsl:stylesheet>

Cut and past the code to a file using any text editor.  Then, go to your module and upload the xsl file to your site, and specify it for use with this feed.  You will get the basic look and feel, including pictures, because that content is enclosed in the description using html, which this xsl allows. 

However, you need to understand that this xsl may not display any tag with a feedburner reference, because we did not include that namespace into the xsl.  The above example will generally display any RSSv2.0 feed without custom namespaces.  That's a whole other topic, which I have offerred an example xsl in other posts.

I've used the above example successfully on my test DNNv04.04.1 site, and it works.  So, give it a go, and do search and seek out other info which will help you explore RSS and XSL.  It's very powerful, and DNN's implementation is simple, but not restrictive when you understand how to do it with custom xsl files and how to understand dissecting RSS feeds in general.

Cheers,

iwonder
 

 
New Post
3/16/2007 5:21 AM
 

iwonder that was an excellent reply. Thanks for taking the time, what I needed to know. I get what you are saying now after a few hours spent on w3 schools (as recommended by the dnncreative tutorial), the mist is lifting a bit but as you say its a bit of a learning curve.

If anybody knows of any other tutorials I think I could do with looking at it from another point of view, I find it always helps with new paradigm.

 
New Post
10/24/2007 4:51 AM
 

I don't know if this will solve this for you but I had the same problem.  The solution was really easy.  I just had to allow Feedburner and Google Reader to access my images that were protected in my .htaccess file.  This article explains how to really easily modify your .htaccess for A) protection against "scraping", i.e. someone stealing your RSS feed, and B) how to allow access to images for your RSS redirects:  http://perishablepress.com/press/2007/07/09/allow-feedburner-access-to-hotlink-protected-images/

Once I added the change, refreshed my WordPress cache, my images showed up beautifully in my RSS feeds.  Read the entire article, but here's an extract of what I put into my .htaccess file to allow Feedburner and Google Reader image access.  Just replace "example" with your own site name:

# Hotlink Protection with Feedburner Access
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://example.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://example.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.example.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.example.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.feedburner.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://feeds.feedburner.com/example-feed$ [NC]
RewriteCond %{HTTP_REFERER} !^http://feeds.feedburner.com/example-feed-comments$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|png|bmp)$ - [F,NC,L

Good luck!

Esbjorn Larsen
www.TechPREE.com

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsRSS Feed not showing picturesRSS Feed not showing pictures


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out