diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 398e56e0b8c..b30c1d1d8dc 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -686,6 +686,15 @@ class navigation_node implements renderable { return !empty($this->action); } + /** + * Used to easily determine if this link in the breadcrumbs is hidden. + * + * @return boolean + */ + public function is_hidden() { + return $this->hidden; + } + /** * Gets the CSS class to add to this node to describe its type * diff --git a/theme/boost/templates/core/navbar.mustache b/theme/boost/templates/core/navbar.mustache index c74410d268b..07d0c0404aa 100644 --- a/theme/boost/templates/core/navbar.mustache +++ b/theme/boost/templates/core/navbar.mustache @@ -31,6 +31,7 @@ * action - string * get_title - string * get_content - string + * is_hidden - boolean Example context (json): { @@ -39,21 +40,25 @@ "has_action": true, "action": "#", "get_title": "Test title", - "get_content": "First & fresh" + "get_content": "First & fresh", + "is_hidden": false }, { "has_action": true, "action": "#", "get_title": "Second item & a title", - "get_content": "Second item" + "get_content": "Second item", + "is_hidden": false }, { "has_action": false, - "get_content": "Third item" + "get_content": "Third item", + "is_hidden": false }, { "has_action": false, - "get_content": "Fourth & last" + "get_content": "Fourth & last", + "is_hidden": true } ] } @@ -62,10 +67,12 @@