Home > SharePoint > How to create RSS Feeds as Ticker in SharePoint 2007

How to create RSS Feeds as Ticker in SharePoint 2007

January 19th, 2009 meher

Using RSS or XML web part in Moss 2007 we can create News ticker.

Steps to create News Ticker.

  1. Add a new RSS or XML web part to page.
  2. Copy the below code in XSL editor
    <xsl:stylesheet xmlns:x=”http://www.w3.org/2001/XMLSchema”
    version=”1.0″ exclude-result-prefixes=”xsl ddwrt msxsl rssaggwrt”
    xmlns:ddwrt=”http://schemas.microsoft.com/WebParts/v2/DataView/runtime”
    xmlns:rssaggwrt=”http://schemas.microsoft.com/WebParts/v3/rssagg/runtime”
    xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:msxsl=”urn:schemas-microsoft-com:xslt”
    xmlns:rssFeed=”urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart”
    xmlns:rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns:dc=”http://purl.org/dc/elements/1.1/”
    xmlns:rss1=”http://purl.org/rss/1.0/” xmlns:atom=”http://www.w3.org/2005/Atom”
    xmlns:itunes=”http://www.itunes.com/dtds/podcast-1.0.dtd”
    xmlns:atom2=”http://purl.org/atom/ns#”>
    <xsl:output method=”html” indent=”no”/>
    <xsl:template match=”/” xmlns:x=”http://www.w3.org/2001/XMLSchema” xmlns:d=”http://schemas.microsoft.com/sharepoint/dsp”>
    <xsl:call-template name=”ticker”/>
    </xsl:template>
    <xsl:template name=”ticker”>
    <xsl:variable name=”StyleName”>Table</xsl:variable>
    <xsl:variable name=”Rows” select=”/rss/channel/item”/>
    <xsl:variable name=”RowCount” select=”count($Rows)”/>
    <xsl:variable name=”IsEmpty” select=”$RowCount = 0″/>
    <xsl:choose>
    <xsl:when test=”$IsEmpty”>
    <xsl:call-template name=”empty”/>
    </xsl:when>
    <xsl:otherwise>
    <table border=”0″ width=”100%” cellpadding=”2″ cellspacing=”0″>
    <tr>
    <td width=”75px”
    style=”font-family:Tahoma;font-size:11px;color:#333″><strong>Head Lines:
    </strong>
    </td>
    <td>
    <marquee direction=”left” scrollamount=”3″ >
    <xsl:call-template name=”tickerBody”>
    <xsl:with-param name=”Rows” select=”$Rows”/>
    <xsl:with-param name=”FirstRow” select=”1″/>
    <xsl:with-param name=”LastRow” select=”$RowCount”/>
    </xsl:call-template>
    </marquee>
    </td>
    </tr>
    </table>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name=”tickerBody”>
    <xsl:param name=”Rows”/>
    <xsl:param name=”FirstRow”/>
    <xsl:param name=”LastRow”/>
    <xsl:variable name=”GroupStyle” select=”‘auto’”/>
    <xsl:for-each select=”$Rows”>
    <!– insert your own preferred image here –>
    <img src=”_layouts/images/navlink.gif” mce_src=”_layouts/images/navlink.gif”
    border=”0″/>
    <img src=”_layouts/images/blank.gif” mce_src=”_layouts/images/blank.gif”
    height=”1″ width=”6″ alt=”Icon” border=”0″/>
    <a style=”display:{$GroupStyle}” target=”_blank”>
    <xsl:attribute name=”href”>
    <xsl:value-of select=”link”/>
    </xsl:attribute>
    <xsl:value-of select=”title”/>
    </a>
    <img src=”_layouts/images/blank.gif” mce_src=”_layouts/images/blank.gif”
    height=”1″ width=”20″ alt=”Icon” border=”0″/>
    <!– add this line below for up marquee <br/> –>
    </xsl:for-each>
    </xsl:template>
    <xsl:template name=”empty”>
    <xsl:variable name=”ViewEmptyText”>There are no current announcements.</xsl:variable>
    <table border=”0″ width=”100%”>
    <tr>
    <td >
    <xsl:value-of select=”$ViewEmptyText”/>
    </td>
    </tr>
    </table>
    </xsl:template>
    </xsl:stylesheet>
  3. Copy your RSS link in “RSS FEED URL” text box
    Ex:
    http://www.ibeesolutions.com/Templates/feed.aspx

    and click ok
Categories: SharePoint Tags:
Comments are closed.