Pagelist Plus, a MojoMotor Add on - aaronfowler/mojo-pagelistplus GitHub Wiki

PageListPlus Introduction

Expand the options available to MojoMotor's native page_list tag

Basic usage

The basic tag will output an unordered list of all pages. The tag adds the url_title to all nodes in the CSS-class. The products page will have class="mojo_page_list_products".

NOTE: the mojo:site:page_list tag uses ID="mojo_page_list_url_title" instead, for all its nodes, which would make multiple lists on a page somewhat problematic, because in general "ID" must be unique.

Next to adding class="mojo_active" to the current page, PageListPlus adds some extra classes. "parent_active" is added to parent pages, and "has_kids" is added when a page has subpages. When visiting the tea-details page, the basic tag outputs the following:

{mojo:pagelistplus:page_list}

- home (class=mojo_page_list_home)
- products (class=parent_active has_kids     mojo_page_list_products)
  - tea (class=parent_active has_kids     mojo_page_list_tea )
     - details (class=mojo_active     mojo_page_list_tea-details)
     - availability (class=mojo_page_list_tea-availability)
  - coffee (etc...)
     - details
     - availability
- about
     - team
     - history
- contact

{mojo:pagelistplus:page_list depth="1"}
The depth parameter will limit output of children to that that depth. Result:

- home
- products
- about
- contact

Where do we "start"

{mojo:pagelistplus:page_list start="root"}
The start-parameter is dynamic and will look at the page that is being visited. The homepage has no children, so the pagelistplus-tag will output nothing on the homepage. With start="root", when you visit the products page or the tea page, PageListPlus will output all the children only below the root-page products.

  - tea
     - details
     - availability
  - coffee
     - details
     - availability

{mojo:pagelistplus:page_list start="parent" header="h3"}
When starting on parent, PageListPlus will only show the children if the current page is not a root-page. This can be useful to show siblings on a detailpage. Visiting the tea-details page, together with using the header-tag, will output the following:

    <h3>Tea</h3>
     - details
     - availability
⚠️ **GitHub.com Fallback** ⚠️