Simple Section Navigation

Download the plugin

Simple Section Navigation is a WordPress plug-in that adds a widget for section based navigation. Easy to configure and essential for CMS implementations!

Description

Adds a widget to your sidebar for section (or top level page) based navigation. The title of the widget is the top level page within the current section. Shows all page siblings (except on the top level page), all parents and grandparents (and higher), the siblings of all parents and grandparents (up to top level page), and any immediate children of the current page. Can also be called by a function inside template files.

It includes a simple widget configuration panel. From this panel you can:

  1. Determine whether the section navigation widget should appear on the home page
  2. Override standard behavior and have the widget show all pages in the current section
  3. Determine whether the widget should appear even if the section only has one page (the top level)
  4. Provide a list of pages to exclude from the output
  5. Determine whether the section navigation should still appear when viewing excluded pages
  6. Determine whether the section title should be linked
  7. Determine page sort order (defaults to menu order)

The widget uses standard WordPress navigation classes, in addition to a unique class around the widget, for easy styling.

Compatible with WordPress MU. General installation instructions.

Upgrading from pre-2.0

Version 2.0 represents a major change to the plug-in’s internal architecture. Version 2 will attempt to seamlessly upgrade the old the widget, but you should document your current settings before upgrading to be safe. If you are calling it by a function in the template (not using the widget), you will be required to update your template, unless you were using the default settings. The function now has 1 parameter: arguments for the output of the widget, as detailed under installation instructions.

Calling section navigation inside template (without widget)

Function name: simple_section_nav()

Parameters:

  • show_all – Always show all pages in current section (default: false)
  • exclude – Page IDs, seperated by commas, of pages to exclude (default: ”)
  • hide_on_excluded – No navigation on excluded pages (default: true)
  • show_on_home – Show top level page list on home page (default: false)
  • show_empty – Output even if empty section (default: false)
  • sort_by – Page sort order; can use any WordPress page list sort value (default: menu_order)
  • a_heading – Link heading to the top level page (default: false)
  • before_widget – HTML before widget (default: <div>)
  • after_widget – HTML after widget (default: </div>)
  • before_title – HTML before widget (default: <h2 class=”widgettitle”>)
  • after_title – HTML after widget (default: </h2>)

Example:

simple_section_nav('before_widget=<li>&after_widget=</li>&exclude=2&show_on_home=1');

Will wrap the widget in LI tags, exclude page ID 2, and will output on home page.

Additional Notes

A full change log is available here.

Possible future features based on demand:

  • Lists private pages if user has permission to see them
  • Light weight mode for sites with only 2 levels of pages

If you’re interested in the origins of this plugin and how it works under the hood, check out this blog post.

As always, feedback and suggestions are welcome!