Copied to clipboard

Flag this post as spam?

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


  • Chris Gaskell 59 posts 142 karma points
    May 27, 2010 @ 11:59
    Chris Gaskell
    0

    Parsing Umbraco page fields within inline .NET in template

    Hi all,

    I have multiple templates on one document type. I'm trying to show / hide a section of HTML in the template based on a page field value.

    I realise the beliow wont work but it's something like that I'm trying to achieve.

       <%if(<umbraco:Item field="showLandingHeader" runat="server"></umbraco:Item> == '1') {%>
            <div id="productLandingTop">
                <umbraco:Macro ID="Macro4" Alias="ProductHeaderImage" runat="server"></umbraco:Macro>
            </div>
       <%} %>

     

    Any ideas?

    Thanks,
    Chris

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    May 27, 2010 @ 12:50
    Lee Kelleher
    0

    Hi Chris, maybe try...

    umbraco.library.GetItem('showLandingHeader') == '1'

    ... to get the item's value?

    (I haven't tested this though.)

    Cheers, Lee.

  • Chris Gaskell 59 posts 142 karma points
    May 27, 2010 @ 12:53
    Chris Gaskell
    0

    Of course....

    I'd forgotten the fab API existed :-)

    Thanks Lee

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies