Products

Solutions

Learn More

Partners

Community

Blog

About

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 FeedsPlease Help me with xsl  !Please Help me with xsl !
Previous
 
Next
New Post
12/9/2011 7:20 PM
 

Hi guys, 

It's been more than a week since I am trying to find/ make a xsl file for this module that actually works, it made me nuts! (I never made xsl file)

I have this Event module RSS that I want get news feed to show me only its title and date ( with out time) , I am reading a lot around it but it seems   every thing they say in tutorials doesn't work on this news feeds ! 

can you please hint  me to some xsl file (I really searched but i couldn't find any!) that convert rss 2  to something that shows title (with link) and date only ? 

my rss is like this :

<rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/"xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<atom:link href="..." rel="self" type="application/rss+xml"/>
<title>läxcoachen - Title</title>
<link>http://...</link>
<description>Description</description>
<ttl>60</ttl>
<item>
<title>Title1 </title>
<description/>
<link>
....
</link>
<guid>
...
</guid>
<pubDate>Thu, 29 Dec 2011 21:00:00 GMT</pubDate>
<dc:creator>hanna</dc:creator>
</item>
<item>
<title>Title2 </title>
<description/>
<link>
....
</link>
<guid>
...
</guid>
<pubDate>Thu, 22 Dec 2011 21:00:00 GMT</pubDate>
<dc:creator>hanna</dc:creator>
</item>

....

for example samples of http://www.dnncreative.com/RSSNewsFee... doesn't work on it ( even untouched !)


thank you very much :)

 
New Post
1/31/2012 9:28 PM
 

I am also looking to limit my RSS feeds to only 2 or 3 posts... can someone help with this? I look at the DNN creative tutorial and had trouble following it.

Thanks

 
New Post
1/31/2012 10:34 PM
 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="limit">10</xsl:param>
  <xsl:template match="/">
    <div class="normal" style="position:relative;">
      <xsl:for-each select="rss/channel/item">
 <xsl:if test="(position( )) &lt;= $limit">
 <b><u><a href="{link}" rel="bookmark">
          <xsl:value-of select="substring(pubDate,0,17)"/>
        </a></u></b>
        <br/>
        <xsl:value-of select="description" disable-output-escaping="yes" />
        <br/>
        <span style="line-height:20%">
          <br/>
        </span>
 </xsl:if>
      </xsl:for-each>
    </div>
  </xsl:template>
</xsl:stylesheet>
 
New Post
2/1/2012 10:04 AM
 

G Hart,

This is perfect. Exactly what I needed. One question... how can I truncate the amount of the text is displays... can I specify a char. count? I changed it to only display 3 RSS items... now I just want o shorten them up a bit. Excellent fix! Thanks again!

 
New Post
2/1/2012 12:07 PM
 
You could truncate the description/text the same way the pubDate was truncated, by using the substring function.  I would not do that unless you are sure about what is in the description field.  Typically this field will contain HTML, so you cannot just truncate it because the tags will no longer make sense.  If you do, you could make the second parameter in the substring function an xml parameter like we did for limit.  This allows you to use the DNN XML module and set the parameter values in each instance.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsPlease Help me with xsl  !Please Help me with xsl !


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