Autonav Exclude Subpages

Concrete5.6 NOTE: This addon's functionality has been included in the built-in autonav block as of Concrete5.6. If you already have the addon installed and working, it is safe to leave it there... but there is *no* reason to install this on a new 5.6 (or higher) site!


Custom template for the Autonav block that adds new functionality and fixes some Concrete5 bugs.

To use this custom template, simply edit a page that has an autonav block, click on the autonav block, choose "Custom Template" from the popup menu, then choose "Exclude Subpages" from the dropdown list and click the "Update" button.

New 'Exclude Subpages from Nav' Attribute

When you install or upgrade this package, a new page attribute called 'Exclude Subpages from Nav' will be added to your site. This functions similarly to the existing 'Exclude from Nav' attribute, except that it allows you to exclude all of a page's "children pages" without having to exclude the "parent page" itself. For example, if you have a top-level "Blog" page on your site and you want that page included in your navigation menu, but you don't want the individual blog posts underneath it to appear in its dropdown menu (because it would get excessively long), you can simply set the 'Exclude Subpages from Nav' custom attribute on the top-level "Blog" page.

Improved 'Exclude From Nav' Functionality

If you want to exclude an entire section of your site from appearing in your nav menu, select this custom template and then set the top-level page of the section to "Exclude From Nav" in the page properties. This saves you from having to set "Exclude From Nav" on every single page underneath that top-level page!

The reason this works is because the autonav block's normal behavior is to show pages that don't have the "Exclude From Nav" property checked even if they are under another page in the sitemap that DOES have the "Exclude From Nav" property checked -- but this custom template changes that behavior so ALL pages underneath a page that's "excluded from nav" are also excluded.

Homepage 'nav-path-selected' fix

This custom template also includes a fix for a Concrete5 bug that caused the 'nav-path-selected' class to be included on the home page navigation item (see this bug for details: https://www.concrete5.org/developers/bugs/5-4-1-1/autonav-should-not-give-nav-path-selected-class-to-home-page-lis/ ).

Approved by PRB

Our 30 Day Support Policy

  • Replies to tickets every few days.

Support Hosted

  • On concrete5.org