I need to get a childs parent node even if is nested 3, 4 or 5 levels deep. For instance:
root
- level 1
-- level 2
--- level 3
---- level 4
----- level 5
On level 2 I have a hierarchical viewer with transformations displaying all pages on level 3 and when a level 3 item is selected level 4 items are displayed in a nested <ul>. I only display 2 nested levels in the navigation but there could be as many as 5 levels below the level 2 page (where the hierarchical viewer is). When the user selects either level 3 or level 4, the css class is set to "current", which works as expected. When they select an item on level 5 how can I set the css class of levels 3 or 4 to "current" knowing that level 5 is still in the node of level 2, 3 or 4?
Right now I can use this
Convert.ToInt32(Convert.ToString(Eval("NodeID"))) == CMSContext.CurrentDocument.NodeParentID
to check 1 level above but this is limiting.