Copied to clipboard

Flag this post as spam?

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


  • Tony 13 posts 43 karma points
    Sep 11, 2012 @ 13:19
    Tony
    0

    Add a location to the event

    Is it possible to define a location of an event listed in the calendar and then change the colour of the the cell background accordingly?

    eg. events in the main hall appear as red, events in the conference room appear green.

    I've got it to change the colour if there is an event but want to change the colour depending on it's location also.

    Any help would be great.

     <xsl:choose>
    <xsl:when test="boolean($cell/event)">
    <td class="caleventfound">

    <xsl:for-each select="$cell/event">
                <a href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="date:dayinmonth($cell/@date)"/>
        </a>
           </xsl:for-each>
      </td>
    </xsl:when>
        
    <xsl:otherwise>
      <td>
        <xsl:value-of select="date:dayinmonth($cell/@date)"/>
      </td>
    </xsl:otherwise>
    </xsl:choose>
  • Peter Dijksterhuis 1442 posts 1722 karma points
    Sep 12, 2012 @ 09:05
    Peter Dijksterhuis
    0

    Hi,

    I presume you have a property which holds the location in your document right?

    You can do something like this:

    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:if test="umbraco.library:GetXmlNodeById(@id)/location = 'mainhall' ">
    <xsl:attribute name="class">yourclass</xsl:attribute>
    <xsl:value-ofselect="date:dayinmonth($cell/@date)"/>
    </xsl:if>
    </a>

     

    this then will set a class on your a if the location is mainhall

    Does this help?

    Peter

  • Tony 13 posts 43 karma points
    Sep 12, 2012 @ 12:05
    Tony
    0

    Thanks for the response AND solution to the problem I had.

    Thankyou!

    Tony

Please Sign in or register to post replies

Write your reply to:

Draft