Frontend\Core\Engine\TemplateModifiers::getNavigation PHP Method

getNavigation() public static method

Get the navigation html syntax: {{ getnavigation($type, $parentId, $depth, $excludeIds-splitted-by-dash, $template) }}
public static getNavigation ( string $type = 'page', integer $parentId, integer $depth = null, string $excludeIds = null, string $template = '/Core/Layout/Templates/Navigation.html.twig' ) : string
$type string The type of navigation, possible values are: page, footer.
$parentId integer The parent wherefore the navigation should be build.
$depth integer The maximum depth that has to be build.
$excludeIds string Which pageIds should be excluded (split them by -).
$template string The template that will be used.
return string
    public static function getNavigation($type = 'page', $parentId = 0, $depth = null, $excludeIds = null, $template = '/Core/Layout/Templates/Navigation.html.twig')
    {
        // build excludeIds
        if ($excludeIds !== null) {
            $excludeIds = (array) explode('-', $excludeIds);
        }
        // get HTML
        try {
            $return = (string) Navigation::getNavigationHTML($type, $parentId, $depth, $excludeIds, $template);
        } catch (Exception $e) {
            // if something goes wrong just return as fallback
            return '';
        }
        // return the var
        if ($return != '') {
            return $return;
        }
        // fallback
        return '';
    }