Copied to clipboard

Flag this post as spam?

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


  • Mr A 216 posts 278 karma points
    Sep 20, 2011 @ 11:10
    Mr A
    0

    Navigation

    Hi , The structure of tree is :

    Home

    About Us

    Location 

    Services

    News

    Products

    Product 1

    Product 2

    Product 3

    Contact Us

    About us node has fixed subnodes while the product has dynamic subnodes., What I want is to show dynamic subnodes of product on all the other pages also (contact us , home , news) , while the about us page should only show the (location and services). Can this scenario achievable . Thanks

     

  • Mr A 216 posts 278 karma points
    Sep 20, 2011 @ 12:37
    Mr A
    0

    I tried something like this on my master page but it only show me the product node , not its children :

    @inherits umbraco.MacroEngines.DynamicNodeContext

    @{      var level = String.IsNullOrEmpty(Parameter.Level) ? 1 : int.Parse(Parameter.Level);

     var bCategories = @Model.AncestorOrSelf(1).Descendants("Products");

     if (bCategories != null) {

            foreach (var cat in bCategories) 

                {

                    @cat.Name

                }

       }

    }

Please Sign in or register to post replies

Write your reply to:

Draft