News Ticker

Discussion in 'XML' started by adam bob, Oct 8, 2007.

  1. adam bob

    adam bob Guest

    Hello,

    I found a useful piece of XSL which enables you to create a ticker
    based on a list. Currently i can only display the Title. Is there a
    way i can display more than one column, i'm sure there is, i need to
    display two further columns from my list. this is the current XSL;


    <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
    xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0"
    exclude-result-prefixes="xsl ddwrt msxsl" xmlns:ddwrt="http://
    schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://
    www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-
    com:xslt">
    <xsl:eek:utput method="html" indent="no"/>
    <xsl:param name="dvt_adhocmode"></xsl:param>
    <xsl:param name="dvt_adhocfiltermode">xsl</xsl:param>
    <xsl:param name="dvt_fieldsort"></xsl:param>
    <xsl:param name="dvt_sortfield"></xsl:param>
    <xsl:param name="dvt_groupfield"></xsl:param>
    <xsl:param name="dvt_groupdisplay"></xsl:param>
    <xsl:param name="dvt_sortdir"></xsl:param>
    <xsl:param name="dvt_groupdir"></xsl:param>
    <xsl:param name="dvt_grouptype"></xsl:param>
    <xsl:param name="dvt_sorttype">text</xsl:param>
    <xsl:param name="dvt_groupsorttype">text</xsl:param>
    <xsl:param name="dvt_filterfield"></xsl:param>
    <xsl:param name="dvt_filterval"></xsl:param>
    <xsl:param name="dvt_filtertype"></xsl:param>
    <xsl:param name="dvt_firstrow">1</xsl:param>
    <xsl:param name="dvt_nextpagedata"></xsl:param>
    <xsl:param name="dvt_apos">'</xsl:param>
    <xsl:param name="filterParam"></xsl:param>
    <xsl:template match="/" xmlns:x="http://www.w3.org/2001/
    XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp">
    <xsl:call-template name="dvt_1"/>
    </xsl:template>
    <xsl:template name="dvt_1">
    <xsl:variable name="StyleName">Table</xsl:variable>
    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/
    Row"/>
    <xsl:variable name="RowCount" select="count($Rows)"/>
    <xsl:variable name="IsEmpty" select="$RowCount = 0"/>
    <xsl:choose>
    <xsl:when test="$IsEmpty">
    <xsl:call-template name="dvt_1.empty"/>
    </xsl:when>
    <xsl:eek:therwise>
    <table border="0" width="100%" cellpadding="2"
    cellspacing="0" class="ms-nav">
    <tr>
    <td class="ms-vb"><marquee><xsl:call-
    template name="dvt_1.body"><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:eek:therwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="dvt_1.body">
    <xsl:param name="Rows"/>
    <xsl:param name="FirstRow"/>
    <xsl:param name="LastRow"/>
    <xsl:variable name="GroupStyle" select="'auto'"/>
    <xsl:for-each select="$Rows">
    <img src="_layouts/images/navlink.gif" border="0"/>
    <img src="_layouts/images/blank.gif" height="1"
    width="10" alt="Icon" border="0"/>
    <a style="display:{$GroupStyle}">
    <xsl:attribute name="href">Lists/Scrolling%20List/
    DispForm.aspx?ID=<xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/
    Transform" select="@ID"/></xsl:attribute>
    <font>
    <xsl:attribute name="size"><xsl:value-of
    select="@Font_x0020_Size"/></xsl:attribute>
    <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>
    <xsl:attribute name="color">
    <xsl:value-of select="@Color"/>
    </xsl:attribute>
    <xsl:value-of select="@Title"/>
    </font>
    </a>
    <img src="_layouts/images/blank.gif" height="1"
    width="20" alt="Icon" border="0"/>
    </xsl:for-each>
    </xsl:template>
    <xsl:template name="dvt_1.empty">
    <xsl:variable name="ViewEmptyText">There are no current
    announcements.</xsl:variable>
    <table border="0" width="100%">
    <tr>
    <td class="ms-vb"><xsl:value-of
    select="$ViewEmptyText"/></td>
    </tr>
    </table>
    </xsl:template>
    </xsl:stylesheet>


    Many thanks

    Adam
    adam bob, Oct 8, 2007
    #1
    1. Advertising

  2. adam bob

    Pavel Lepin Guest

    adam bob <> wrote in
    <>:
    > I found a useful piece of XSL which enables you to create
    > a ticker based on a list. Currently i can only display the
    > Title. Is there a way i can display more than one column,
    > i'm sure there is, i need to display two further columns
    > from my list. this is the current XSL;


    [snip stylesheet]

    http://catb.org/~esr/faqs/smart-questions.html

    Your stylesheet is several pages long, poorly formatted,
    full of 0xa0's, contains a lot of stuff irrelevant to your
    predicament and lacks a sample input document.

    --
    It is rare to find learned men who are clean, do not stink,
    and have a sense of humour. -- Liselotte in a letter to
    Sophie, 30 Jul 1705
    Pavel Lepin, Oct 8, 2007
    #2
    1. Advertising

  3. adam bob

    adam bob Guest

    On 8 Oct, 15:21, Pavel Lepin <> wrote:
    > adam bob <> wrote in
    > <>:
    >
    > > I found a useful piece of XSL which enables you to create
    > > a ticker based on a list. Currently i can only display the
    > > Title. Is there a way i can display more than one column,
    > > i'm sure there is, i need to display two further columns
    > > from my list. this is the current XSL;

    >
    > [snip stylesheet]
    >
    > http://catb.org/~esr/faqs/smart-questions.html
    >
    > Your stylesheet is several pages long, poorly formatted,
    > full of 0xa0's, contains a lot of stuff irrelevant to your
    > predicament and lacks a sample input document.
    >
    > --
    > It is rare to find learned men who are clean, do not stink,
    > and have a sense of humour. -- Liselotte in a letter to
    > Sophie, 30 Jul 1705


    thanks for the help, VERY useful
    adam bob, Oct 9, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roedy Green
    Replies:
    2
    Views:
    452
    Roedy Green
    Aug 4, 2003
  2. LarsR

    News Ticker

    LarsR, Jul 29, 2004, in forum: Java
    Replies:
    0
    Views:
    492
    LarsR
    Jul 29, 2004
  3. ©®

    Scrolling news ticker

    ©®, Nov 18, 2003, in forum: HTML
    Replies:
    8
    Views:
    10,880
    Safalra
    Nov 19, 2003
  4. Replies:
    0
    Views:
    307
  5. Tamer Ibrahim

    News Ticker

    Tamer Ibrahim, Feb 10, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    325
    Alexey Smirnov
    Feb 11, 2009
Loading...

Share This Page