Copied to clipboard

Flag this post as spam?

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


  • Dave Rollins 35 posts 48 karma points
    Aug 13, 2009 @ 12:56
    Dave Rollins
    0

    HowTo Reference Umbraco Page Properties From Embedded Master Page Script

    At the master page level I would like to control whether or not my bread crumb displays... (actually I really want to know how I can access any and all default page properties from master page code).

    So from within my master page I want to do is something like this:

    <% if(umbraco.Page.Level > 2) { %>
       <div id='crumbs'>
            <umbraco:Macro Alias="SubPageBreadCrumb" runat="server"></umbraco:Macro>
            </div>
    

    <% } %>

    Does anyone know how to reference these values. I spent some time looking at the API documentation but was not quite sure which direction to jump in.

     

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    Aug 13, 2009 @ 13:09
    Richard Soeteman
    0

     Hi I would suggest that you do this in your SubPageBreadCrumb XSLT.

    In you Macro you'll include the following if statement

    <xsl:if test="$currentPage/@level &gt; 2">
    <div id='crumbs'>

     Orginial breadcrump macro code here
    </div>
    </xsl:if>
     

    I would always try to avoid inline asp.net code in my masterpage.

    Hope this helps you,

    Richard

  • Dave Rollins 35 posts 48 karma points
    Aug 14, 2009 @ 13:13
    Dave Rollins
    0

    Richard, thanks for your help... I modified my macro XSL something similar to what you've suggested here and it does what I need.

  • Richard Soeteman 4054 posts 12927 karma points MVP 2x
    Aug 14, 2009 @ 13:59
    Richard Soeteman
    0

    Great, glad I could help. Could you be so kind and mark the answer as solution?

    Thanks

  • 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