Hierarchy of BigTree

Your homepage is the root of your site. With a page ID of 0, it is the ancestor of every page powered by the CMS. With the exception of the homepage, all pages are children of another page. The page directly above another page in the hierarchy is its parent.

Top-level pages are those that appear directly beneath the homepage in the site hierarchy. Your site's main navigation will consist of visible top-level pages, but top-level pages also will include hidden pages that are direct descendants of the homepage. You can create a hidden page by unchecking the Visible in Navigation checkbox on the properties tab while editing a page in the admin.

You also have the option to set a page as a trunk in the hierarchy.

Drawing Navigation

To retrieve an array of the main navigation (all top-level pages and immediate children) use $cms->getNavByParent(0,2). The first parameter is the ID of the parent page—which in this case is 0, referring to the home page—while the second parameter refers to how many navigation levels to return, in this case 2. A constant value 0 as the function's $parent parameter will return the same result regardless of the page context.

Array (
    [1] => Array (
            [id] => 1
            [parent] => 0
            [title] => About
            [route] => about
            [link] => http://example.com/about/
            [new_window] => 
            [children] => Array (
                    [3] => Array (
                            [id] => 3
                            [parent] => 1
                            [title] => History
                            [route] => about/history/
                            [link] => http://example.com/about/history/
                            [new_window] => true
                            [children] => Array()
                    )
            )
    )
    [2] => Array (
            [id] => 2
            [parent] => 0
            [title] => Store
            [route] => store
            [link] => http://example.com/store/
            [new_window] => 
            [children] => Array ()
    )
)

Breadcrumbs

Breadcrumbs provide a direct, sequential path from the current page to the homepage. If the current page is a descendant of a page marked as trunk, it will return a path from the page back to the trunk page.

$cms->getBreadcrumb() provides a complete breadcrumb trail when provided with the current page's ID.

Array (
    [0] => Array (
            [id] => 1
            [title] => About
            [link] => http://example.com/about/
    )
    [1] => Array (
            [id] => 3
            [title] => Locations
            [link] => http://example.com/about/history/
    )
)