Copied to clipboard

Flag this post as spam?

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


  • Hemant 45 posts 66 karma points
    Jul 06, 2012 @ 14:53
    Hemant
    0

    Find all the child node of specific node.

    Hi all,

    I want to find the child node of one specifice child node.
    Below is my node stucture :

    -->Content

    -->Language Checking

    -->English

    -->Danish

    -->DA

    -->Home

    -->About us (I am here)

    -->Contacts

    -->EN

    -->Home

    -->About us

    --------------------------------------------------

    Curently, i am on ABOUT US page.

    Now, i want for prepare the list of language list that are the child node of  Language Checking Node.

    I want to prepare it in razor.

     

    Any help would be appreciated.

    Thanks in advance.

  • Tony Kiernan 278 posts 341 karma points
    Jul 09, 2012 @ 14:53
    Tony Kiernan
    0

    I think the lack of a top level parent node makes this problematic. Ireckon your easiest way is to to hadcode the node id. Not ideal.

    Or maybe consider restructuring your content like so:

    • Content
      • Language Checking
        • DA
          • Home
          • About us (I am here)
          • Contacts
        • EN
          • Home
          • About us

    Then you would use

    Model.AncestorOrSelf(1).Children;

    (I'd also make dictionary items for the node names - DA etc)

  • Hemant 45 posts 66 karma points
    Jul 09, 2012 @ 15:08
    Hemant
    0

    Hi Tony,

    I used this : @Model.NodeById(-1).Children

    And from root node , i found the what i want.
    i solved that.


    Thanks for your help. :)

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft