Copied to clipboard

Flag this post as spam?

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


  • Echilon 29 posts 49 karma points
    May 17, 2010 @ 11:30
    Echilon
    0

    Show property1 if property2 empty

    I have a template which uses two similar fields, one for page title in the head and one for a more friendly title (non-SEOd in the body). Is it possible to show the first if it's not empty, but otherwise show property2. Obviously both could be blank in which case it would just show property2, which would be blank.

  • Sebastiaan Janssen 5045 posts 15478 karma points MVP admin hq
    May 17, 2010 @ 11:34
    Sebastiaan Janssen
    2

    Yes, in your template you could do something like this:

    <umbraco:Item field="property1" useIfEmpty="property2" runat="server"></umbraco:Item>

    In XSLT you could just use an xsl:choose construction.

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    May 17, 2010 @ 11:36
    Hendy Racher
    3

    Hi, how about:

    <umbraco:Item field="property1" useIfEmpty="property2" runat="server"></umbraco:Item>
  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    May 17, 2010 @ 11:37
    Hendy Racher
    0

    Snap :)

  • Echilon 29 posts 49 karma points
    May 17, 2010 @ 21:25
    Echilon
    0

    Great. Thanks. :)

Please Sign in or register to post replies

Write your reply to:

Draft