NodeHasChildren of a specific Page Type

Duncan Koza asked on October 12, 2019 00:00

{% If (NodeHasChildren) { } %}

Is there a way to change this so I can say something along the lines of If NodeHasChildren of a specific page type?

Recent Answers


Dmitry Bastron answered on October 14, 2019 00:59

Hi Duncan,

Try something like this: {% if (CurrentDocument.Children.Any(ClassName == "DancingGoat.Article")) { "test1" } else { "test2" } #%}

0 votesVote for this answer Mark as a Correct answer

Duncan Koza answered on October 16, 2019 20:09

Thanks Dmitry,

That does work but it didn't work the way I intended it to work within my Hierarchical viewer (web part).

I found that since I standardized a specific page type called "custom.sjcg_PageFolder" before the children pages I wanted to capture, I can just do this instead:

{% If (ClassName=="custom.sjcg_PageFolder") { } %}

Thanks for your help though.

0 votesVote for this answer Mark as a Correct answer

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