Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robert J. Bullock 386 posts 405 karma points
    Oct 13, 2009 @ 18:14
    Robert J. Bullock
    1

    PD Calendar... Get Next Recurrence!

    This was really getting me for awhile... How to get the next recurrence of an event that uses the PDCalendar package. Well, here it is:

     

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>

    <xsl:stylesheet 

    version="1.0" 

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 

    xmlns:msxml="urn:schemas-microsoft-com:xslt"

    xmlns:exslt="urn:Exslt.ExsltCommon"

    xmlns:date="urn:Exslt.ExsltDatesAndTimes"

    xmlns:umbraco.library="urn:umbraco.library"

    xmlns:pdcalendar ="urn:pdcalendar"

    exclude-result-prefixes="msxml exslt date umbraco.library pdcalendar">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:variable name="messages" select="pdcalendar:GenerateDates('2009-1-1','2012-12-31','eventDate')" />

    <xsl:param name="currentPage"/>

    <xsl:param name="eventID" select="/macro/eventID"/>

    <xsl:template match="/">

    <xsl:for-each select="$messages/node[child::*/@id=$eventID][1]">

    <xsl:if test="count(.) &gt; 0">

    <xsl:value-of select="umbraco.library:LongDate(@date)"/>

    </xsl:if>

    </xsl:for-each>

    </xsl:template>

     

    </xsl:stylesheet>

  • Siw Ørnhaug 130 posts 109 karma points
    Sep 13, 2012 @ 13:22
    Siw Ørnhaug
    0

    I found this and suddenly realized that I didn't have to traverse the umbraco.config xml to find what I needed.

    A great relief when I had to produce lists of 2 preceding events and 2 upcoming events in a list, picked from a mix of single and recurring events, and supplied with other properties from the event document page.

    Thanks for sharing!

Please Sign in or register to post replies

Write your reply to:

Draft