Copied to clipboard

Flag this post as spam?

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


  • BarneyHall 141 posts 210 karma points
    May 20, 2010 @ 11:42
    BarneyHall
    0

    Display event date on recurring event instances

    Hello.

    Would anyone know how to display the events date on the event page (rather than the calendar).

    I can select the <pdcstart> node but if a user clicks through on a recurring date for the event (i.e. next's months) I need to display the date for that instance of the event. This seems a little more complicated...

    Many thanks,
    Barney

  • BarneyHall 141 posts 210 karma points
    May 21, 2010 @ 16:44
    BarneyHall
    0

    Can no one help? Was ticking along nicely until I stumbled into this requirement.

  • BarneyHall 141 posts 210 karma points
    May 22, 2010 @ 14:47
    BarneyHall
    1

    Ok figured this one out myself.

    Being such a newb this made my brain fizz since the date for any recurring event isn't stored - it just has its start date stored. I guess the iteration is stored somehow too, but I couldn't figure that out.

    And just in case anyone else is wondering, I got around it by passing the date via the querystring.

    So I added ?date={../@date} to the end of the link in the calendar XSLT control. This picks up the date from the parent of the current event while the links are being looped through and created on the calendar control.

    <a href="{umbraco.library:NiceUrl(@id)}?date={../@date}">

    On my event page I added an XSLT control that had something to sniff the value of querystring:

        <xsl:variable name="eventDate">
            <xsl:choose>
                <xsl:when test="string-length(umbraco.library:Request('date')) &gt; 0">
                    <xsl:value-of select="umbraco.library:Request('date')"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="''"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

     

    And then just formatted it nicely in the page as such:

    <xsl:value-of select="umbraco.library:FormatDateTime($eventDate, 'dddd, d MMMM, yyyy')"/>

     

    Probably simple stuff to most folks on here, but hope it helps someone.

    Many thanks,
    Barney

     

Please Sign in or register to post replies

Write your reply to:

Draft