Copied to clipboard

Flag this post as spam?

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


  • Clare 37 posts 117 karma points
    Jul 09, 2013 @ 17:46
    Clare
    0

    Display text if date empty

    I'm trying to get a template to display a date a certain way but also show the text 'TBC' if no date is selected by the editor.

    What I'm trying at the moment is the below which works fine if there is a date selected but if no date is selected it shows a random date rather than the text 'TBC'

    <p><umbraco:Macro Alias="DateFormat" dateFormat="dddd d MMMM yyyy  H:mm" propertyAlias="closingDate" textIfEmpty="TBC" runat="server" /></p>
  • Peter Grillo Frederiksen 34 posts 67 karma points
    Jul 15, 2013 @ 13:07
    Peter Grillo Frederiksen
    0

    Would it not be easier to make a macro, and the making a

    <xsl:choose>
    <xsl:when test="[datefield] != "">
    Hello world
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="[datefield]/>
    </xsl:otherwise>
    </xsl:choose> 
Please Sign in or register to post replies

Write your reply to:

Draft