An array of SiteNavItems representing the children this SiteNavItem.
Some optional [[BaseObject]] that this SiteNavItem represents
Finds an optional child page using the isFound callback function.
Callback to indicated if child SiteNavItem was found
Optional
fullTree: booleanWhen false - the default, do not search through all the pages's descendants.When true search until all sub-pages of the current page have been searched. The fullTree search does this via a depth traversal, meaning that if two children have the label that is being searched for, it will choose a page with a smaller 'level' value over a page with a higher 'level' value. If the pages are at the same level, it will choose the one that comes first.
// Find the first child that is a leaf child
let optFoundChildNavItem = navItem.optFindBy(childNavItem => childNavItem.isLeaf(), true);```
// Find the first child who's label is 'label'
let optFoundChildNavItem = navItem.optFindBy(childNavItem => 'label' === childNavItem.label(), true);
// or
let optFoundChildNavItem = navItem.optFindByEquals('label', childNavItem => childNavItem.label());
// or
let optFoundChildNavItem = navItem.optFindByLabel('label', true);
Finds an optional child page using name - value custom properties
The custom property name of the SiteNavItem to be searched. Since pages of different types can have the same property, and pages of the same type can have the same property if the name of the property begins with an under-bar, there is no guarentee that only one page will have the given property. In this case the first such page will be returned as determined by search.
Custom property value
Optional
fullTree: booleanSee [[optFindByLabel]]
// Find the first child who's custom property is {'jack', 'box'}
let optFoundChildNavItem = navItem.optFindByAltId('jack', 'box', true);```
Finds an optional child page. It will do an equals check on the callback function. Same as navItem.optFindBy(childNavItem => value === toT(childNavItem), fullTree);
Value to search and check against
Callback to check if it equals value.
Optional
fullTree: booleanSee description in [[optFindBy]] with the same name.
// Find the first child who's description value is 'A description'
let optFoundChildNavItem = navItem.optFindByEquals('A description', childNavItem => childNavItem.description(), true);```
Finds an optional child page. Same as navItem.optFindByEquals(value, childNavItem => childNavItem.id(), fullTree);
The id of the SiteNavItem to be searched.
Optional
fullTree: booleanSee description in [[optFindBy]] with the same name.
// Find the first child who's id is 'id'
let optFoundChildNavItem = navItem.optFindById('id' , true);```
Finds an optional child page. Same as navItem.optFindByEquals(value, childNavItem => childNavItem.label(), fullTree);
The id of the SiteNavItem to be searched.
Optional
fullTree: booleanSee description in [[optFindBy]] with the same name.
// Find the first child who's label value is 'black label'
let optFoundChildNavItem = navItem.optFindByLabel('black label' , true);```
An optional SiteNavItem representing the parent SiteNavItem of this SiteNavItem. The root SiteNavItem will have no parent.
Generated using TypeDoc
Returned by [[B.siteNavigation]]
Example