Copied to clipboard

Flag this post as spam?

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


  • Rocoeh 65 posts 86 karma points
    Oct 09, 2012 @ 12:34
    Rocoeh
    0

    Hiding by alias

    I am itterating through the children of a node

     

    @{
                      
       var links = Library.NodeById(1472);
       var count = 0;
       foreach(var item in links.Children)
       {

    //do stuff

    }

    }

     

    However these is one node that I do not want to output. I am aready using umbracoNaviHide for the menu how do I hide this node by alias? 

     

    Thanks.

     


              
           

       
          

  • Christian Bech 20 posts 51 karma points
    Oct 09, 2012 @ 12:57
    Christian Bech
    0

    You could try something like this

    @{
                      
       var links = Library.NodeById(1472);
       var count = 0;
       foreach(var item in links.Children)
       {

     if (@item.NodeTypeAlias != "theAlias") {

     //do stuff

          }

    }

    }

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 09, 2012 @ 13:01
    Fuji Kusaka
    0

    Hi Rocoeh,

    Try doing this instead

    foreach(var item in links.Children.Where("Visible").Where("NodeTypeAlias == \"yourAlias\"")){
    @item.Name
    }

    //fuji

Please Sign in or register to post replies

Write your reply to:

Draft