CM Table of Contents (CMTOC) - Use Case - How to Manage Multiple Pages With One Table of Contents
Use Case - How to manage multiple pages with one Table of Contents
Note: This guide requires:
- CM Table of Contents (CMTOC) - This document uses version 1.4.11
The CM Table of Contents plugin is one of the best table of contents WordPress plugins. It helps users easily navigate your WordPress posts. The TOC plugin can automatically generate and insert an easy to use, user friendly navigation section to the post headers.
Use Case Front-End
Use Case Assumptions
In this use case you will get to know how manage multiple pages with one table of contents.
We consider that you have already bought the plugin, but not installed it.
- Installing the plugin
- Quick recap
- Configuring the pages
- End result
Installing The Plugin
The process is the same for all CM plugins and add-ons.
- Download the add-on from your customer dashboard
- Log in to WordPress and navigate to the WordPress Admin → Plugins settings.
- Click on Add New
- Activate it and add the license
Learn more: Getting Started - Plugin Overview
In this guide we will consider only the situation where we need to have a common table of contents for a few multiple different pages. So we won't consider here the whole process of adding and configuring the table of contents. You can learn more about the following questions in this guide: CM Table of Contents (CMTOC) - Use Case - How to Create a Table of Content for Articles on Your Site
- Choose post types to display the Table of Contents
- Adding Tables of Contents to posts/pages
- Manually Placing Table of Contents Using the Shortcode
- General styling
- Add "Back to the top" button
- Floating TOC
It is possible to display a Table of Contents for multiple different pages using the Table of Contents plugin. This allows for the key content across different pages to be displayed on one or all of the pages to assist navigation. To implement this, pages that are need to be clustered in the same table of contents must be related as Parent / Child pages.
Note: this feature works only with pages - posts are not supported to implement this.
So, let's start configuring the Table of Contents.
One important option is needed to be enabled in settings, so navigate to Admin Dashboard → CM Table of Contents Pro → Settings → Table of Contents → General Settings section.
Find and enable the option Include the pages parent/child elements in the TOC by default as it's shown on the screenshot below:
And then click the button Save Changes at the bottom of the page or in the floating window:
Configuring the Pages
To connect a few pages between themselves navigate to Admin Dashboard → Pages → All Pages.
For our example we prepared in advance a few pages - three books about Nancy Drew. So, the first book will be a Parent, and books 2 and 3 will be its Child pages.
You need to choose the page that will be a Parent and edit it. In our example it is a page "Book 1: Nancy Drew - Movie Madness".
While editing the page scroll down to the bottom of the page to the box CM Table of Contents - Custom Selectors and enable the option Add items from the descendant pages to the Table of Contents.
Note: make sure that the option Search for Table Of Contents items on this post/page must be also enabled on all pages where the TOC is needed - on the Parent page and on Child pages.
There you can also choose how the child pages should be ordered by. There are 5 different types of ordering in the option Which field the child pages should be ordered by:
- Post Name
- Post Title
- Page Order
And 2 options in the dropdown Order in which the child pages will be added to Table of Contents:
- ASC - Ascending order.
- DESC - Descending order.
Note: if you choose the Page Order type of ordering, you will have to define this order by setting a number for every Child page in Page Attributes.
Then click the Update button at the top right to save the changes.
Now we need to configure Child pages. In our example they are the pages with "Book 2" and "Book 3".
Let's start editing one of them. While editing the page you need find there on the right side a metabox Page Attributes. In the field Parent Page choose the page that should be a Parent (the one we defined in the previous chapter).
And, in case if you chose the Page Order type or ordering on the Parent page, here in the field Order you need to set the number - that is the number this page will be ordered in the Table of Contents. In this case it will be number 2. For another Child page it will be 3 and so on. You decide the order they will appear on the Front-end.
Then click the Update button at the top right to save the changes, and repeat this process for the other Child pages.
Now everything is done, so let's see the result on the Front-end.
Use Case Front-End