Hierarchical Viewer Menu Child Pages for document types

Dcode warner asked on October 28, 2018 07:43

Using the Hierarchical Viewer as a main menu works fine except it somehow interprets all document types in the CMS admin tree as children to the first Level pages and adds the 'data attribute' [code below]. Despite not having 'show in navigation' under page Properties checked.

<%# Eval<bool>("NodeHasChildren") ? " data-toggle='dropdown' data-hover='dropdown'" : "" %>

The where condition in the transformation is already set as: DocumentMenuItemHideInNavigation = 0. I tried also implementing a'Show In Main Nav' field with a checkbox. But the where condition throws a loading error.

How can I make the 'NodeHasChildren' find or filter only the 'sub.pages' document types and ignore the others?

Recent Answers

Brenden Kehren answered on October 28, 2018 13:38

The value of NodeHasChildren is an aggragated value of all page types and DOES NOT CHANGE based on what your WHERE clause has in it. If you want to filter that at a lower level you need to make a custom transformation method.

0 votesVote for this answer Mark as a Correct answer

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