Copied to clipboard

Flag this post as spam?

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


  • djscorch 67 posts 106 karma points
    Jan 17, 2012 @ 15:07
    djscorch
    0

    useIfEmpty question

    Currently I have this:

    <title><umbraco:Item field="pageTitle" useIfEmpty="pageName" runat="server" /></title>

    I want to prepend some text to the useIfEmpty value. Is this possible?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 17, 2012 @ 15:09
    Jeroen Breuer
    0

    Try this:

    <title><umbraco:Item field="pageTitle" useIfEmpty="pageName" insertTextBefore=" - " runat="server" /></title>

    Jeroen

  • djscorch 67 posts 106 karma points
    Jan 17, 2012 @ 15:11
    djscorch
    0

    Won't that insert the text before the field value also?

    I only want to insert text before, if the useIfEmpty field is used.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 17, 2012 @ 15:15
    Jeroen Breuer
    0

    Hmm only if useIfEmpty is used... Don't think that is possible. You'll probably need to do use some XSLT or Razor for this.

    Jeroen

  • djscorch 67 posts 106 karma points
    Jan 17, 2012 @ 15:43
    djscorch
    0

    A quick bit of Razor did the trick ;)

Please Sign in or register to post replies

Write your reply to:

Draft