Sharepoint RSS ticker

One of the MOSS 2007 SharePoint web parts is an RSS or XML web part which can take XML content and transform it. Making a new ticker was tricky in 2003, though there was a nice solution I found here.

In the new web part you can use this code to display a simple HTML marquee element based on the RSS content found:

<xsl:stylesheet xmlns:x="" xmlns:d="" version="1.0" exclude-result-prefixes="xsl ddwrt msxsl" xmlns:ddwrt="" xmlns:xsl="" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="html" indent="no"/>

<xsl:template match="/" xmlns:x="" xmlns:d="">
<xsl:call-template name="ticker"/>

<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:when test="$IsEmpty">
<xsl:call-template name="empty"/>

<table border="0" width="100%" cellpadding="2" cellspacing="0" class="ms-nav">
<td class="ms-vb">

<marquee direction="right" onMouseover="this.scrollAmount=2"  onMouseout="this.scrollAmount=6">
<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: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="10" alt="Icon" border="0"/>
<a style="display:{$GroupStyle}">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
<!-- change this to have a fixed style
<xsl:attribute name="size">
<xsl:value-of select="@Font_x0020_Size"/>
<xsl:attribute name="style">
<xsl:if test="@Bold &gt; 0">font-weight:Bold;</xsl:if>
<xsl:if test="@Italics &gt; 0">font-style:Italic;</xsl:if>
<xsl:attribute name="color">
<xsl:value-of select="@Color"/>
<xsl:value-of select="title"/>
<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

<xsl:template name="empty">
<xsl:variable name="ViewEmptyText">There are no current announcements.</xsl:variable>
<table border="0" width="100%">
<td class="ms-vb">
<xsl:value-of select="$ViewEmptyText"/>

Comments (10)
  1. Hitman322 says:

    Nice one. Now how to scroll horizontally?

  2. drmcghee says:

    Hi there,

    You need to change the marquee element to what you would like.

    I changed the sample to: direction="right"

  3. jsharetech says:

    this is nice. how do you change the scroll speed?


  4. mbiker says:

    Hi. Does it work with WSS3.0? I’ve found the XML Web Part and pasted the code into the XML Editor text area. I should change the <xsl:variable name="Rows" select="/rss/channel/item"/> line isn’t it? Could you give me an example please?


  5. Claudia says:

    I am looking for something like this but does this code works with external RSS feeds? Or only internal feeds?  And where in the code should I place the location of the feed? Thanks in advance.

  6. Natdob says:

    Goto into Sharepoint, add a RSS webpart, edit the webpart and add your feed into the RSS Feed URL. Then click on the XSL editor and paste the above code.

  7. Joe says:


    to change the speed, alter the values in the line:

    <marquee direction="left" onMouseover="this.scrollAmount=2"  onMouseout="this.scrollAmount=6">

    0 = stop scrolling

    100 = very very fast!

  8. Podgey1 says:

    Good afternoon, This code works great and I have the ticker tape running across the top of the page!  I am not familiar with XML however and would like to ask how I change the background to white or transparent and the font to dark grey, Verdana 11.  Thank you.

  9. sander says:

    Hi there, How can I change the font and background color of the RSS newsfeed within the webpart?

  10. Sharepointnubie says:

    This is great but the scroll starts over as soon as it reaches the left border. How Do I keep it scrolling all the way through the RSS feed list?

Comments are closed.

Skip to main content