Bluestep JS Documentation
    Preparing search index...

    Class SiteNavItem

    Returned by [[B.siteNavigation]]

    let navItem = B.siteNavigation();

    
    
    Index

    Constructors

    Methods

    • A string containing an HTML img tag which will display a larger BlueStep icon corresponding to the type of page.

      Returns string

    • A optional string value containing the URL of a larger BlueStep icon corresponding to the type of page.

      Returns string

    • A number indicating the number of child pages available from this SiteNavItem.

      Returns number

    • An array of SiteNavItems representing the children this SiteNavItem.

      Returns Optional<SiteNavItem>

    • A string value containing the description of the page represented by this SiteNavItem.

      Returns string

    • A string containing the URL of the standard BlueStep icon corresponding to the type of page

      Returns string

    • A string containing an HTML img tag which will display the standard BlueStep icon corresponding to the type of page.

      Returns string

    • A string value containing the internal id of the page represented by this SiteNavItem.

      Returns string

    • A number containing the index of the current SiteNavItem in its parent's list of children.

      Returns number

    • A boolean value indicating whether this SiteNavItem represents the currently navigated page

      Returns boolean

    • A boolean value indicating whether this SiteNavItem is childless.

      Returns boolean

    • A boolean value indicating whether this is the root SiteNavItem. The root SiteNavItem represents the site itself, is at level 0, and has no parent.

      Returns boolean

    • A boolean value indicating whether this SiteNavItem represents the currently navigated page or one of its parent pages.

      Returns boolean

    • A string value containing the name/label of the page represented by this SiteNavItem

      Returns string

    • A number indicating the level of the page within the navigation tree. Primary navigation is level 1. Children of these navigation items are level 2, or secondary navigation. Children of level 2 are level 3 and so forth.

      Returns number

    • Some optional [[BaseObject]] that this SiteNavItem represents

      Returns Optional<BaseObject<any>>

    • Finds an optional child page using the isFound callback function.

      Type Parameters

      • T

      Parameters

      • isFound: (childNavItem: SiteNavItem) => boolean

        Callback to indicated if child SiteNavItem was found

      • OptionalfullTree: boolean

        When 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.

      Returns Optional<SiteNavItem>


      // 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

      Parameters

      • name: string

        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.

      • value: string

        Custom property value

      • OptionalfullTree: boolean

        See [[optFindByLabel]]

      Returns Optional<SiteNavItem>


      // 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);

      Type Parameters

      • T

      Parameters

      • value: T

        Value to search and check against

      • toT: (childNavItem: SiteNavItem) => T

        Callback to check if it equals value.

      • OptionalfullTree: boolean

        See description in [[optFindBy]] with the same name.

      Returns Optional<SiteNavItem>


      // 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);

      Parameters

      • id: string

        The id of the SiteNavItem to be searched.

      • OptionalfullTree: boolean

        See description in [[optFindBy]] with the same name.

      Returns Optional<SiteNavItem>


      // 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);

      Parameters

      • label: string

        The id of the SiteNavItem to be searched.

      • OptionalfullTree: boolean

        See description in [[optFindBy]] with the same name.

      Returns Optional<SiteNavItem>


      // 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.

      Returns Optional<SiteNavItem>

    • A string indicating the type of page represented by this SiteNavItem

      Returns string

    • A string value containing the URL of the page represented by this SiteNavItem.

      Returns string