Show in Navigation value when selecting nodes

Rita Mikusch asked on September 2, 2016 19:22

Hi,

This works ... but it's not complete: var documents = tree.SelectNodes().Types("CMS.MenuItem", "cpabc.landing").Path(Path, PathTypeEnum.Children).NestingLevel(1).OnSite("CpaBc").Published(true);

I only want documents that have the "show in navigation" checkbox checked off. But I can't figure out how I would check for that value in my c# code?

Would anybody here have any suggestions?

Correct Answer

Jim Spillane answered on September 2, 2016 21:58

Try adding the a Where for DocumentMenuItemHideInNavigation.

var documents = tree.SelectNodes()
    .Types("CMS.MenuItem", "cpabc.landing")
    .Path(Path, PathTypeEnum.Children)
    .NestingLevel(1)
    .OnSite("CpaBc")
    .Published(true)
    .Where("DocumentMenuItemHideInNavigation", CMS.DataEngine.QueryOperator.Equals, "0");
0 votesVote for this answer Unmark Correct answer

Recent Answers


Virtuoso Engineering answered on September 2, 2016 22:04

Hi Rita,

You can filter by the field called DocumentMenuItemHideInNavigation. Just add .WhereEquals("DocumentMenuItemHideInNavigation",0)

Thanks. Have a great day!

0 votesVote for this answer Mark as a Correct answer

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