<?php
/*
if (!empty($p) && $p instanceof Page) {

    // Work out if need to traverse to section header or if this is a section

    $top_parent = $p->get_top_parent_id($p->id);

    if ($p->id == $top_parent) {
        $section_id = $p->id;
    } else {
        $section_id = $p->sub_id;
    }

    // Create section page object
    $section = new Page($section_id);

    // Expose Section page object to twig
    $twig->addGlobal('section', $section);

    $sidebar_navigation = CMSNav::tree($section_id, PHP_INT_MAX);

    // Expose Section Menu array to twig
    $twig->addGlobal('section_menu', $sidebar_navigation);

}
*/
