Version 4 > User Guides > Navigation

Navigation and Menus

Your website navigation is determined by your website structure, and your menus and indexes can be generated automatically. This guide explains how navigation works, and how to configure it.

Navigation Levels

There are three types of navigation:

  1. Primary Navigation: these are the main destinations on your web site, which will appear in your website menus, and your site map. Broadly speaking, each of these destinations is a page, although they can in practice be a variety of page-like objects. (More specifically, it is any content object with a navigation type of "page".)
  2. Secondary Navigation: these are secondary content items, which are situated within page(s) that contain that them. It includes all content objects with a navigation type of "item". For example, a calendar will contain events. The calendar itself is page-like and will be part of the primary navigation that is accessible from your menus. The events are secondary items that are accessible from the calendar's index.
  3. Tertiary Navigation: this is all of the other content on your web site, which is not included in automatically-generated menus or indexes. This includes all content with a navigation type of "none". All navigation to tertiary content must be set up manually, by linking to the content in appropriate places. If you do not link to tertiary content, then that content will not be discoverable by web site visitors clicking around. If you want to drive visitors to those locations, the links will have to be distributed in some other way (for example, by email or social media).

Navigation Structure

Website content is related to other website content through a parent-child relation. Every piece of content has a parent, which indicates which other content it lives "under".

The top-level content consists of the section (or home page) and all of the pages that are situated under the section. Together, these comprise the "top menu".

Under each page there can be other pages, which comprise a "sub-menu" under its respective top page. Under each of those pages can be another sub-menu, and so on, to whatever depth is necessary.

Indexes

Secondary content is located under its container page, but is not included in regular menus. Instead, it is shown in the index to the content, which is usually part of the page body.

The index is simply a listing of all the secondary content items within the page. The format will vary depending on the type of page. For example, events in a calendar will be listed differently than articles in a blog, or products in a catalog.

Typically, items in an index will be displayed using the summary format for that content type. For example, articles will be listed using the article_summary format, wheres events will be listed using the event_summary format. From the summary, you can usually click through to the full content. Summary formats all have predefined defaults, but you can override these with your own formats using configuration settings like

content.format.article_summary = [HTML markup for article listings]
content.format.event_summary = [HTML markup for event listings]
...etc

Hidden Pages

Pages are included in menus and site maps by default. If you do not want them to be included, use the "Hide From" setting in the page configuration to hide them from menus or site maps, as needed.

Similarly, secondary content items can be hidden from indexes in the same way.

Note that only active/published content will be included in your automatically-generated navigation. Disabled and archived content will always be hidden.

Site Map

The site map is a nested list showing all of the primary navigation points on your website in a single view.

Menus

Menus are lists of pages that you can embed in your templates to provide standardized navigation from everywhere in your website. They can be formatted in numerous ways, for example:

  • a list of the "top pages" in your site
  • a list of the top pages, with selected pages expanded to include their sub-menu
  • a list of the top pages, with submenus that popup or fly out dynamically when you mouse over them
  • a list of the pages in the sub-menu you are currently within

These listings can be formatted horizontally (eg. a menu bar), vertically (eg. a sidebar menu), or both (eg. a menu bar with drop-down submenus).

There is no preset mark-up for presenting menus. That part of menu building is handled by a menu plug-in, of which there are several to choose from (see below). The low-level CMS itself does not generate menu mark-up, it only generates the menu structure, which the menu plug-in then uses to generate its own mark-up to display the menu. This lets you change your menu presentation with a quick switch of your menu plugin, or mix-and-match your menu styles throughout your site, or even on a single page.

Menu Categories

Sometimes you want to divide your site into submenus, but you don't want a top-level page to hold the submenu. To illustrate, a normal site map has a set of top pages, each with its own submenu:

  • top page A
    • sub page A1
    • sub page A2
  • top page B
    • sub page B1
    • sub page B2
    • sub page B3

The menu for this site map will show pages A and B in the top/main menu, and those pages exist in addition to and separate from their sub-menus.

But in some cases you might just want the A and B submenus, without the A and B top-level pages:

  • group A
    • page A1
    • page A2
  • group B
    • page B1
    • page B2
    • page B3

To organize your site this way, set up your site map the same as above, but configure A and B to have a content type of "category" rather than "page". A category is just a container for grouping your content, but doesn't actually contain any content of its own. It will still appear in menus, but only for the purpose of holding the sub-menu. You will not be able to navigate to the category URL.

Irregular Menu Items

To include something in your menu that is not a regular page, start by setting up a regular page object that will serve as the menu item. In the configuration for that page, you can manually specify the URL to use for its menu link. Enter the URL to your special content in that field. It can be a URL from your own site, a different site entirely, or a custom URL that you have configured your webserver to respond to (eg. a 302 redirect). Other than that URL, and the menu label, the page does not need to have any other content or settings.

This trick has numerous uses, for example:

  • link to other sections or 3rd party websites
  • link to PDF documents or other tertiary content
  • allow a secondary content item (like an event or news story) to be used as a primary menu item

Menu Plug-ins

Generating the actual HTML and Javascript to render your menus is the job of a menu plug-in. You have several choices included in the standard system, and can also write your own if none of these are suitable.

SimpleMenu

SimpleMenu generates HTML menus in a number of formats. It's menus are HTML-only; that is, there are no Javascript animations or other dynamic effects. It allows for simple but flexible markup, and can output five different types of navigation:

  • horizontal menus: men items are shown side-by-side, as in a menu bar
  • vertical menus: menu items are listed in a stack, as in a sidebar
  • sitemap: displays the entire site as a nested list
  • path: current page is shown as a breadcrumb listing from the home page, through the submenus, to the current page
  • next: shows a link/button to go to the next page in the sitemap (the next page is determined by a depth-first traversal of the site map)

It can also display submenus in a variety of ways:

  • as an embedded submenu in a vertical menu
  • as a separate vertical menu
  • as a 2nd horizontal menu bar under the main menu

SimpleMenu will automatically append a logout link to the main menu if the current user is logged in.

To customize the mark-up used in these menus, you can use the following configuration settings in the SimpleMenu.conf file. The settings shown will give a simple but functional menu.

# hmenu_spacer goes between your horizontal menu items
hmenu_spacer =  | 
# pmenu_spacer goes between your path/breadcrumb links
pmenu_spacer =  > 
# vmenu_spacer goes between your vertical menu items
vmenu_spacer = <br>
# submenu_prefix goes before each submenu item, for example, to indent
submenu_prefix = &nbsp;&nbsp;&nbsp;&middot;&nbsp;

For more sophisticated control of your markup, add the following content objects to your website template:

Vertical menus:

  • SimpleMenuTop - this content will be placed before all menu links.
  • SimpleMenuMid - this content will be placed between all menu links.
  • SimpleMenuBot - this content will be placed after all menu links.

Horizontal menus:

  • SimpleMenuTopH
  • SimpleMenuMidH
  • SimpleMenuBotH

These content objects can contain whatever markup you want to wrap your menu links in.

The menu links themselves are simple anchor tags with a class of "menu", and possibly one of the following IDs:

  • toppage: this indicates that the menu item is the parent page of a submenu
  • thispage: this ID indicates that the menu item is for the page that is currently being viewed

Usage:

<!--&SimpleMenu(keywords)-->

keywords are comma-separated

Keywords are:

  • one of the menu types noted above (horizontal, vertical, path, sitemap, next)
  • submenu, submenu-only (to generate a submenu rather than a main menu)
  • parent, section=NNN (to generate a menu for a different section)

BSmenu

BSmenu generates Bootstrap menus for your site. These include the following menu formats:

  • nav - a basic nav menu structure.
  • nav-vertical - uses flex-column to stack the links vertically.
  • nav-tabs, nav-pills - basic horizontal menubar with tabs or pills styling.
  • menubar - a full-width menubar.
  • menu - a vertical menu box.

Usage:

<!--&BSmenu(keywords)-->

keywords are comma-separated

In addition to the menu type, from the listing above, the following keywords are recognized:

  • deep - adds drop-down submenus for deep navigation
  • login - adds login/logout links.
  • form - adds special form markup/widget from the configuration file. (Eg. search form)
  • section=X - displays menu for (sub)section X instead of the current section.

SMenu

SMenu generates SlickNav menus for your site. SlickNav automatically pops up submenus for deep navigation, and is fully responsive and mobile-friendly.

Usage:

<!--&SMenu()-->

Behaviour is fine-tuned with configuration settings, not with keyword arguments.

VMenu

VMenu is for generating expandable/collapsible vertically-formatted menus. A jquery plugin handles the animations.

Usage:

<!--&VMenu()--> generates a full site menu (works best as a sidebar menu)
<!--&VMenu(type=submenu-only)--> generates a submenu for the currently-viewed page
<!--&VMenu(page_id=xxx)--> generates a submenu for a specific page
<!--&VMenu(mode=sitemap)--> generates a site map

CMenu

CMenu is an alternate menu plug-in for generating cascading drop-down menus and sub-menus. A jquery plugin handles the animations.

Usage:

<!--&CMenu()-->

generates a full site menu (works best as a menubar)