Copied to clipboard

Flag this post as spam?

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


  • Gary 40 posts 129 karma points
    Aug 28, 2013 @ 12:43
    Gary
    0

    Only show if there is content

    Hello,

    I'm looking for some beginner guidance.

    In my template i have this code

    <div class="layout" style="float:left; width:320px; font-size:0.9em;">
                    <umbraco:Item field="orgNumber" runat="server" /><br/>
                    <umbraco:Item field="orgTown" runat="server" /><br/>
                    <umbraco:Item field="localAuthority" runat="server" /><br/>
                    <umbraco:Item field="orgPostcode" runat="server" /><br/><br/>
                    T:<umbraco:Item field="orgTel" runat="server" /><br/>
                    F:<umbraco:Item field="orgFax" runat="server" /><br/>
                    E:<umbraco:Item field="orgEmail" runat="server" /><br/>
                    W:<umbraco:Item field="orgWebsite" runat="server" /><br/>
                </div>
    

    How can i get it to only show the details if information has been entered?

    Thanks

    Gary

  • Kim Nedergaard 37 posts 144 karma points
    Aug 30, 2013 @ 07:35
    Kim Nedergaard
    100

    Hi Gary,

    You can use the "Insert before", field. In the "Insert umbraco page field" dialog.

    When you edit your template - you can click "Insert umbraco page field". Then select "orgTel" in the Choose field drop down. Afterwards write "T:" in the "Insert before field".

    Now will T: only be rendered when "orgTel" has a value.

    <umbraco:Item field="orgTel" insertTextBefore="T:" runat="server" />
    

    Hope this help :)

  • Gary 40 posts 129 karma points
    Aug 30, 2013 @ 12:02
    Gary
    0

    Thanks for helping a beginner Kim!!

Please Sign in or register to post replies

Write your reply to:

Draft