CSS List Menu - showing only child of current node

Tomáš Vodrážka asked on March 2, 2014 08:29

Hello, I would like to show only childs of current page. I can use /{0}/{1}/{2}/% in path,but when node has no childs I would like to show nodes at its level. I loaded nodes at the same level and one more level with path /{0}/{1}/{2}/../% and then in where condition choosed which to display by {% if (NodeChildNodesCount == 0){ "NodeParentID = " + CurrentPageInfo.NodeParentID } else{ "NodeParentID = " + CurrentPageInfo.NodeID

}

%}

It works fine but when childs are news or events I thinks that node has childs, but then i wont display them, so No data found.

Any Ideas how to solve it?

Recent Answers


Brenden Kehren answered on March 2, 2014 17:20

The webpart has a property called Maximum nesting level, set it to 1 and it will select only the first level below your current select node.

1 votesVote for this answer Mark as a Correct answer

Tomáš Vodrážka answered on March 3, 2014 01:32

Thanks for your reply. I forget to mention I already use this. I max. nesting level 2 and therefore I load nodes at the same level and their child nodes. It works. But problem is that I can not recognize whether I can display that nodes or not, because NodeChildNodesCount counts documents, events etc. as well. Problem is only in case node has no menu child nodes, but has documents or events.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 3, 2014 03:11

Hi,

Yes the NodeChildNodesCount takes into consideration any document of any type placed underneath the parent node. So, you need to create a more complex macro condition and check the child nodes document type (class names) as well and exclude the not wanted document types.

Best regards,
Juraj Ondrus

0 votesVote for this answer Mark as a Correct answer

Tomáš Vodrážka answered on March 3, 2014 03:41

Yes, but how? Is there any documentation talking about these macro functions? Thanks

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 3, 2014 06:57

There is some info here on Custom Macros and registering them.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.