Good day,
Can someone help me please. Thank you
Instead of checking if the SubLevelPlaceHolder is empty, you can check if node has children with this code <%# IfCompare(Eval("NodeChildNodesCount"),0,"Children","NoChildren") %>
<%# IfCompare(Eval("NodeChildNodesCount"),0,"Children","NoChildren") %>
Hi,
I put this macro in Item transformation Level 0 to detect node children but it show the class to all pages who has child or no child Level1.<li <%# IfCompare(Eval("NodeChildNodesCount"),0,"class=\"parent\"","") %>>.
Hi Rafik,
Sorry I now see that this is removed in Kentico 8.2.
I have two solutions:
Change your transformation to XML, this also performance better and then use this :
{% Documents.Where("NodeID = " + NodeID).FirstItem.Children.Count > 0 ? "class=\"parent\"" : String.Empty |(identity)GlobalAdministrator%}
Or write your own function like described here : http://devnet.kentico.com/questions/child-node-count-in-transformation
Please, sign in to be able to submit a new answer.