Skip Navigation

[Resolved] CPT documentation with TOC

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 4 years ago.

Assisted by: Nigel.


How to create a TOC for a CPT of documentation



Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

You have a couple of choices.

One is to make a "Chapter" post type, and then make a one-to-many relationship between Chapters and Documents, organising the documents into chapters.

To display on the front-end you would have an outer View to display the chapters, and an inner View to display the documents for that chapter.

Ordering might be an issue. You could add a numeric custom field to the document post type to specify ordering. When editing a chapter where you can see the connected documents at the bottom of the page you can choose to show the order field and then re-order the documents by it. (You would use the same field to order the documents on the front-end, too.)

See this documentation for details:

Alternatively, you could make your documentation post type hierarchical (an option in the settings for the post type) so that you can nest document posts, treating the top level as "chapters" and the nested level as "documents".

If you use the plugin I recommended in the previous thread (WP Nested Pages) it would give you a simple drag and drop interface for organising the documentation in the backend. I expect it will have something to reproduce that ordering on the front end, but you would need to consult its documentation.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.