Copied to clipboard

Flag this post as spam?

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


  • Niels Pedersen 18 posts 49 karma points
    Aug 02, 2012 @ 16:00
    Niels Pedersen
    0

    List all pages in project

    Hi

    What I believed was a simple script, has really been troubling me for some time now - so i hope somebody can help.

    I want to list all pages in content - no regards to which level they are on. Just as a simple list and links to the specific page.

    I have gotten as far as listing the pages - but sub-pages is only shown if the parent is set to show=true. If the parent is not set to show=true, all the subpages with show=true will not be shown. Here is the code:

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @helper traverse(dynamic node){
       var items node.Children.Where("visITopmenu == True");  
       foreach (var item in items{
              <li><href="@item.Url">@item.Name</a></li>
              @traverse(item)
                }
    }
       @traverse(@Model.AncestorOrSelf())

    Hope anybody can help - let me know if something is missing

    Thanks in regards

     

  • 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