Copied to clipboard

Flag this post as spam?

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


  • Mark Evans 86 posts 116 karma points
    Aug 22, 2014 @ 17:43
    Mark Evans
    0

    creating dynamic menu from a certain level

    i have a megu menu working fine from the top level of the site but cannot seem to create an equivalent menu 4 levels down...

    i assumed it would be as easy as setting the start page at the right level or document type

    where i had -

    var homePage = @Model.Content.AncestorsOrSelf(1).First();

    i have tried

    var homePage = @Model.Content.AncestorsOrSelf(4).First();

     

     

     

    var homePage = @Model.Content.AncestorOrSelf("Stream");

     

    var homePage = @Model.Content.Descendants(4).first();

    but none seem to work...

    or am i better starting at the homepage and checking for the right level within the forweach loop?

    @foreach (var page in homePage.AncestorOrSelf(1).Children.Where("Visible"))

    how would  i add another check here for document type alais or level ?

     

     

     

     

     

     

     

     

     

     

     

     

  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    Aug 22, 2014 @ 17:47
    Jeavon Leopold
    0

    If you want the first level 4 node going up the tree from the node being rendered then this is fine?

    var homePage = Model.Content.AncestorOrSelf(4);
    

    Perhaps a screen shot of you expanded tree would help us understand your issue....?

  • 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