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 ForumsRepositoryRepositoryRepository News Feed XSL ExampleRepository News Feed XSL Example
Previous
 
Next
New Post
4/14/2006 11:27 AM
 

Hi,

There was a question about customizing an XSL Stylesheet for the repository, so i started a new thread here.

My Newsfeed shows on the home page like this:

Files added on: Thu Apr 13, 2006
Intersky Summer 2006

Files added on: Sun Apr 09, 2006
European Air Express
MaxjetSummer 2006
Dauair

The XSL stylesheet reads through the entrys, takes the newest 5 dates, then for each date, lists the titles of the files added, and sorts them alphabetically under each date.

Here is the stylsheet.

<?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"/>
<xsl:key name="FilesByDate" match="item" use="substring(pubDate, 1,16)" />
<xsl:template match="rss/channel">
  <xsl:for-each select="item[count(. | key('FilesByDate', substring(pubDate, 1,16))[1]) = 1]">
    <xsl:if test="position() &lt; 6">
    <br/><font style="font-weight : bolder; text-decoration: underline; ">Files added on: <xsl:value-of select="concat(substring(pubDate, 1,3),' ',substring(pubDate, 9,4),substring(pubDate, 6,2),', ',substring(pubDate, 13,4))"/></font>
    <br/>
      <xsl:for-each select="key('FilesByDate', substring(pubDate, 1,16))">
      <div class="itemtitle">
      <font style="font-weight : normal; ">
      <a href="{guid}" title="{description}"><xsl:value-of select="substring-after(title,'File Library - ')" disable-output-escaping="yes"/></a></font>
      </div>
      </xsl:for-each>
    </xsl:if>
  </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Line 4 sets up a variable for me to use elsewhere in the stylesheet, called FilesByDate

Line 6 starts counting the number of dates, and line 7 checks to make sure i have not used more than 6 dates, which gives me my 5 dates i want to display.

Line 8 starts the "Files added on" Date line in my feed, but, then sorts the date in the way i want it displayed.

Line 11 lists the files for each date, and line 14 sets up the title, removing the libray module name from the title, url link to the file, and shows description when you move the mouse over the url.

Thats pretty much it. Check out www.dnncreative.com for some easy XSL stylesheet pointers.



Gary
 
New Post
4/26/2006 5:43 AM
 
Great work Gary - I have been searching for some good XSLT stylesheets for my RSS feeds!


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryRepository News Feed XSL ExampleRepository News Feed XSL Example


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