Table of Contents Creator

Download Latest version: 1.6.4.1 (updated on 13 June 2010)

Features | Screenshot | Download | Configuration | FAQ | Comments | Demo

Version 1.6.4 now released! The following new features have been added. This release is all about giving more control to your visitors…

  • Sidebar widget support.
  • Hierarchial categories are now supported.
  • Child elements can now be dynamically expanded or collapsed by a vistor.
  • The table of contents can now be dynamically sorted in several different orders by a visitor.
  • All summaries can be dynamically shown or hidden by a visitor.
  • Page help is now available to users by clicking the help icon.

Have a play by viewing this site’s Table of Contents.


Please Help! Assistance in interpretation, the creation of new icon sets or just suggesting great new features would be greatly appreciated. All assistance will be acknowledged on the TOCC settings page with a link provided to your site. Please register your interest via the Contact Me page or as a comment below. Thank you.

If you find the plugin useful, please vote for it here.

Features

Table of Contents Creator (TOCC) automatically generates a dynamic site wide table of contents that is always up-to-date. All entries are navigable making your site extremely SEO friendly. TOCC can be configured to display static pages, blog posts and forum comments. TOCC may also include anchor tags marked with a special class within the table of contents. This feature allows links to articles, downloads or even other sites to appear within the table of contents as if they are part of your site’s navigation. One more great feature of TOCC is the automatic summary generator. A short summary describing each page or comment can be automatically created and added to each page or post item in the table of contents. The summary is a great way for people to quickly determine what each page or post is about without wasting valuable time. Finally, the way in which the table of contents is generated is extremely configurable and even contains a choice of several icon themes.

To generate a table of contents, simply include the <!-- toc-creator --> tag on any page, or use the handy page creation feature located on the plugin admin page.

Note that the table of contents is automatically generated every time it is displayed and as such it is always up to date! New comments, pages, blogs and blog catagories will automatically appear as soon as they are published.

You never need to lift a finger. TOCC will do all the work for you!

Please note: TOCC has been designed to be as resource friendly as possible. However if your site is relatively large or you are frequented by many visitors, TOCC may increase host CPU loading and memory usage. It may therefore be advantageous to consider installing a caching plugin such as WP-Super Cache. TOCC integrates with WP-Super Cache and will automatically clear the cache when any options have changed. It is also recommended that WP-Super Cache be configured to automatically clear the cache when a new post is added.

XHTML CertifiedContent generated by the Table of Contents Creator plugin is validated XHTML compliant.

download_button

Download

Latest version: 1.6.4.1
Requires at least: WordPress 2.7
Tested up to 2.9.2

The plugin can alternatively be downloaded from the WordPress plugin repository.

You are free to use the plugin under terms specified by GPL.

Installation

  1. Download the installation file from here, extract it into your plugin folder and activate it.
  2. Edit the TOCC settings using the admin page located under settings.
  3. Place <!-- toc-creator --> anywhere on a page or use the page generator on the admin page. Use the HTML editor when placing the tag.

Sidebar Widget

New to version 1.6.4 is the sidebar widget. This feature allows you to display the table of contents within the sidebar of each page. Dynamic sorting is unfortunately not available within the widget.

Anchor Links

Anchors can be displayed within the table of contents. To include an anchor, simply add class="tocc" to any anchor tag. Anchor links will be displayed under the page in which they were located.

The Summarizer

The Summarizer will display a page or post summary below each item in the table of contents. It is set by default to automatically acquire the summary from one of several different sources, however it may be configured to retrieve summaries from one source only. Currently, TOCC interrogates the following sources:

  • The All in One SEO plugin. This plugin is used by many to produce SEO friendly META descriptions.
  • Any custom configurable page or post META tag,
  • The post or page excerpt.
  • The post ot page content.

The Summarizer uses jQuery textual effects to slowly scroll summaries and includes options for the reader to displaying all summaries, hide all summaries or display individual summaries. All buttons dynamically change on hover and are theme sensitive.

Examples

A TOC using the professional icon theme.


TOC using square icon theme and drop down menu.


TOC without icons. Single list.


TOC handdrawn. No author or date.


TOCC configuration snippet.


Configuration

TOCC is configured with defaults that will suffice the needs of most users. There are loads of configuration options though that you can tweak to help blend the table of contents with you blog style and personal tastes. None of the options break anything and are, for the most part, self explanatory. If you run into trouble, click on the option text within the plugin settings page to display detailed help.

All available options are detailed below…

General Options
  • Table of Contents Title: This text entered here will be displayed at the top of the table of content page. Leave blank to display no title. Include any required formatting tags.
  • Icon Theme: Select the icon theme used to display next to each table of contents entry. Icon themes are a set of icons that are related in look and style. Icons are used to differentiate pages, links, blog categories, blog entries and form comments. Select none to inhibit the displaying of icons.
  • Default Sort Order: Selects the default sort order for pages and posts. The sort order can be overridden by a vistor using the options menu.
  • Date Format: Used to set the date display format when showing blog or forum comment dates. See http://php.net/manual/en/function.date.php for format string details.
  • Show Separate Lists: Displays the page list, blog posts and forum comments as separate lists under a configurable title. See the settings below for Page Title, Blog Title and Forum Comments Title. The title strings may contain HTML formatting tags.
  • Show Options Menu: Displays a menu at the top of the table of contents page allowing vistors to format the table of contents. Options include expand and contract child elements, show or hide summaries and sort the table of contents.
  • Option Menu Item Texts: This is the text used for each option menu item. It is settable so that the menu can be easily modified to reflect the blogs host language. Ensure that the menu items appear in the same order. Commas are used to delimit each menu item and should therefore not be used in a menu item description.
  • Options Menu Border Color: A small options menu is displayed to each visitor allowing them to sort the table of contents, expand or collapse child elements and display or hide summaries. This option defines the color used for the menu border and separator bars. HTML color codes can be found here. Dont forget to include the leading hash.
  • Show Help: Selects whether to display help instructions to the user. Valid options are Never, Always, Hidden by Default (with help icon), Shown by Default (with help icon).
  • Help Icon ToolTip: Tooltip text to be displayed when the user hovers the mouse over the help icon. Applicable only if help icon is selected in above option.
  • Help Text: Help text to display when the user clicks the help icon. Not applicable if show help is set to never.
  • Allow Children to be Expanded and Collapsed: Allows parent elements, such as a page with sub pages or a category with posts, to expand or collapse the child elements similar to a tree view in Windows Explorer.
  • Hide Children by Default: Hides all children by default. This option will only be used if the above option is selected.
  • Author Prefix: The text to be displayed before the authors name.
  • More Prompt: If enabled, the more prompt is displayed at the bottom of the blog posts and forum comments lists if not all posts or comments are displayed. clicking the link will display a new page showing all available posts or comments. This enables a smaller subset of the posts and/or comments to be displayed on the main site-map allowing greater readability.
  • Show Author Credit: Displays a small unobtrusive acknowledgement at the bottom of the table of contents. Please consider leaving the acknowledgement enabled as a token of appreciation for the hours spent developing this plugin.
Summarizer Options
  • Show Summary: If enabled, a small summary is automatically created for each page or post. The summary may be hidden by default allowing visitors to dynamically show or hide summaries as required. Summaries may be extracted from All in One SEO descriptions, post excerpts, post or page body text or custom META tags.
  • Extract Summary From: Determines where the page or post summary is to extracted from. If Auto is selected, a number of different methods are examined in hierarchial order to obtain the first non-blank description. Other valid options include All in One SEO description tags (requires the All in One SEO plugin to be installed), Post Excerpt, Page or Post Body and Custom META. The option below can be used to configure the custom META tag.
  • Custom Summary Extraction META: Defines the custom META tag if selected above. WordPress allows custom fields to be added to a page or post. The custom fields are displayed as META tags in the post or page header and can be used by search engines. If you do not use the All in One SEO plugin, it is a good idea to create a custom Description META and include a brief description of the post in the value field.
  • Summary Length Limit: Sets the maximum number of characters to display for each summary. Set to 0 to disable this option. It is a good idea to keep this short to reduce page load times if the table of contents contains many pages or posts.
  • Display Ellipses if Summary Exceeds Limit: If set, ellipses (…) will be displayed if the extracted summary exceeds the above summary length limit.
  • Hide Summaries by Default: Summaries may be hidden or shown by default. Selecting None will display all summaries. Select All to hide all summaries. Select Parent to hide the summaries of all parent pages (those with children). Select Children to hide the summaries of all children pages.
  • Allow Individual Summaries to be Shown or Hidden: If selected, visitors will have the option of displaying or hiding summaries for individual posts or pages. A small icon will be displayed next to the post or page.
Static Page Options
  • Show Static Pages: Show static pages within the table of contents. Note that the pages will be sorted in menu order. Use the order attribute of each page (settable via page edit) to set the menu order.
  • Page Title: This text is used as the page list heading. The page list heading is only displayed if the separate page, blog post and forum comment lists option is checked. See General Settings for more information.
  • Page Depth: Determines the page depth to display. For example if set to 1, all parent pages will be shown and the immediate children of each parent page will also be shown. Set to 0 to show parent pages only.
  • Link Class: If set, any <a> tags assigned to this class will be shown as a list item under the page in which the link was found. To use, add class=”linkclass” to each <a> tag you wish to display in the table of contents. Leave blank to disable this option.
  • Show Page Author: Displays the author of the page.
  • Show Page Date: Displays the creation date of the page.
  • Show Page Comment Count: Displays the number of page comments next to each page listing.
  • Exclude Pages: Select one or more pages to exclude from the table of content. By default, all pages are enabled.
Blog Post Options
  • Show Blog Posts: Show blog entries within the table of contents. Blog entries will automatically be separated by category.
  • Blog Title: This is a mock page name used for sites that do not have a static post page. See the WordPress Settings/Reading option for more details. The blog title is also used if static pages are not displayed or page lists, blog posts and forum comments are separately displayed.
  • Show Posts Total: Displays the total number of posts in brackets for each category next to each category listing.
  • Category Prefix: Displays this text before each blog category. Leave blank if you do not wish to display a prefix. The prefix may include HTML code.
  • Number of Blog Posts: Determines the maximum number of blog entries to display in each category. Set to a value equal to or less than zero to display all posts.
  • Don’t Show Categories: If selected, all posts will be shown in one large list without being separated into individual categories. Use this option if your blog does not make use of post categories.
  • Show as Flat List: If selected the blog categories will not be displayed as an indented hierarchial list, but instead as a flat list.
  • Show More Prompt: Displays a link at the bottom of the posts list to display more posts. The link will only be displayed if the current number of posts is limited (see the option above). The link text is set in the general options section.
  • Show Posts Warning: Displays a message after the blog page name to alert the reader that only the latest n posts are shown. This text is not shown if all posts are displayed (by entering 0 in the “Number of Blog Entries” setting below).
  • Post Warning Text: The message to display if the post warning is enabled. Use {x} as a place holder for the number of blog entries being displayed.
  • Show Post Author: Displays the author of the post.
  • Show Post Date: Displays the creation date of the post.
  • Show Post Comment Count: Displays the number of post comments next to each post listing.
  • Exclude Categories: Select one or more categories to exclude from the table of content. By default, all categories are enabled.
Forum Note that currently this option only works with Forum Server and WP-Forum.
  • Show Forum Comments: Show forum comments within the table of contents. The latest forum comments will be shown first. Note that currently this option only works with Forum Server and WP-Forum.
  • Forum Title: This text is used as the forum list heading. The forum list heading is only displayed if the option is checked to separate the page, blog post and forum comment lists. See General Settings for more information.
  • Forum Page Name: This is the name of the WordPress page that is used as a place holder to display the forum. The page name is required so that the plugin can display the forum comments underneath the correct page name. The forum page typically consists only of a tag such as <!--VASTHTML-->.
  • Number of Forum Comments: Determines the maximum number of forum comments to display. The latest comments will be displayed first. Set to 0 to display all comments (not recommended).
  • Show More Prompt: Displays a link at the bottom of the comments list to display more comments. The link will only be displayed if the current number of comments is limited (see the option above). The link text is set in the general options section.
  • Show Comments Warning: Displays a message after the forum page name to alert the reader that only the latest n comments are shown. This text is not shown if all comments are displayed (by entering 0 in the “Number of Forum Comments” setting below).
  • Comment Warning Text: The message to display if the comment warning is enabled. Use {x} as a place holder for the number of commebt entries being displayed.
  • Show Comment Author: Displays the author of the comment.
  • Show Comment Date: Displays the creation date of the comment.

FAQs

When I add a new page or post, do I need to tell TOCC?

No. TOCC will automatically add new pages, blog categories and entries, forum comments and links to the table of contents. A new table of contents is generated every time the page is displayed.

Where does the Summarizer get its text from?

The Summarizer is a great feature of TOCC that automatically produces a short summary of each page or post. It first attempts to retrieve the summary from the All in One SEO Plugin. If none was found, it then looks inside a custom META tag, then the post excerpt, then the post content. If all this fails, a message is displayed indicating that no description exists for this page or post. The summary is then stripped of any HTML tags and truncated to a configurable length before it is displayed.

Why is it that some static pages don’t display in the table of contents?

Private pages are not included in the table of contents. Furthermore, you can inhibit pages from displaying using the admin settings page.

What is an anchor link?

Anchor links are <a> tags that have been marked with a special class. By default, any anchor tag that include the text class="tocc" will be included as a link in the table of contents. Note that the class identifier can be changed via the admin settings page.

Can I edit the way the table of contents is displayed?

Definitely! There are many options on the admin settings page that allow you to individualise the way the the TOC is displayed. TOCC also ships with a tocc.css file that can be customised to display different icons, text colors and so on. All individual elements within the TOC can be formatted within the css file.

Can I display more than one TOC with different options?

Yes you can, however you need to override the options using the trigger tag. For example, <!-- toc-creator show_menu=yes|icon_set=2|show_static=|@blog_exclude=5,20,3,15,85 --> will display a TOC with an options menu, the square icon set, no static pages and multiple excluded blog categories. The blog and post category IDs are shown within the TOC settings page. All TOC option names are listed in an array at the top of the source code.

The option syntax is as follows: text to the left of the equals sign is the option name, text to the right is the value (leave blank to disable the option), | separates options, and @ is used to indicate to the preprocessor that the option value is actually a comma separated array list.

I don’t want to allow my visitors to sort by author. How do I do this?

All pull-down menu entry texts are configured within the general options pane within the plugin settings page. To disable any option within the menu, simply delete the text after the comma. Do not remove the comma.

Some of my pages are place holders only. How do I stop TOCC from adding a link to these pages?

There are two ways to do this. First, you can exclude pages using the TOCC settings page. This will also exclude all children of the page and therefore may not suite all users. The other way is to allow TOCC to display the page, but not include a link to the page. This is done by setting a short tag override. To determine the ID of all pages you do not want to show links for, open the TOCC settings page and expand the Static Page Options pane. All pages should be listed here with their ID in brackets. To exclude links, modify the TOCC short tag as per the following example: <!-- toc-creator @link_exclude=749,765 -->. This will not display links for pages with IDs of 749 and 765.

How do I add the TOC to the 404 page?

Within the WordPress theme editor, add the following line within the 404.php file… >?php if(function_exists('tocc_show')) {tocc_show();} ?<. Note that this line can also be added to any page, post or template file.

I note that there is a page and category exclude option, but what if I only want to include a couple of pages or categories?

If you have many pages and categories, and you only want to include a couple of these in the TOC, it may be tedious to individually exclude all other categories or pages. Instead, you could use the @page_include and @blog_include short code overrides. For example <!-- toc-creator @page_include=13,187|@blog_include=8 --> will only display pages with IDs 13 and 187 and categories with ID 8 only.

Is it possible to exclude specific posts from the TOC?

Yes. Use the @blog_postExclude short code override. For example, <!$#45;- toc-creator @blog_postExclude=23,31,45|show_postIDs=yes --> will exclude posts with IDs 23, 31 and 45. Post IDs can be determined by temporarily enabling the show_posIDs short code override. This will show the post ID next to each post in the TOC. Remove this override once you have determined the IDs of the posts to exclude.

Revision History

1.6.4.1
  • Add Persian translation by HamidReza Kazemi. Thank you Hamid.
  • Reduced file size of all icons (by around half) and standardised all icon sets using GIF alpha format. This will increase page load time.
  • Added dynamic removal of non UTF-8 characters from the summary. This was causing some sites to not correctly validate as XHTML.
1.6.4
  • Added table of contents sidebar widget. All widget options are set through the TOCC plugin settings page, however several options have been hardcoded as some options will not work within a widget.
  • Add French translation by Txia. Thank you Txia.
  • Replaced “show help” option with a selection to display the help text always, never, by default or hidden by default. Shown and hidden by default options are supplemented with a help icon to toggle the help text on and off.
  • Now automatically clears wp-supercache cache when TOCC options are updated.
  • Added new short code overrides called @blog_include and @page_include. These allow you to specifically identify which pages and categories are to be included in the TOC.
  • Added new short code override called @blog_postExclude to allow specific posts to be excluded from the TOC. Also added a new short code override called show_postIDs to allow post IDs to be temporarily displayed on the TOC.
1.6.3.1
  • Removed self_URL function and now instead use the post permalink as this was incompatible with some servers.
  • TOCC url parameters now append to existing page parameters if they already exist (for example, if using default WordPress permalink settings).
1.6.3
  • Added new option to hide summaries for parent (pages with children), children (non-root pages), none or all pages and posts.
  • Added new option to display the page or post comment count next to each page or post listing.
  • Added new option to inhibit listing of posts under categories and instead show all posts as one large list.
  • Added new option to displat a help icon. When enabled, an icon will be displayed in the top right corner. Clicking the icon will display user definable help text.
  • Added new option to allow user definable text to be prefixed to each category heading.
  • Added new option called “link_exclude” settable via a short-tag overide to exclude links from user selectable pages. See FAQs for more information.
  • The summarizer now uses category descriptions to generate summaries for categories.
  • Fixed compatility issues with Forum Server version 1.4.
  • Prefixed all TOCC classes with “tocc_”. Tocc used common class names such as “footer” and “date”. This conflicted with some themes. The prefix should make all css classes unique, and as such the table of contents should now appear the same across different sites.
  • Modified self_URL function to work with both IIS and Apache. The previous function worked with Apache only.
1.6.2.2
  • Fixed issue with automatic page creator adding the incorrect short code.
1.6.2.1
  • Relaxed reliance on PHP5 by removing function reference parameters with default values. The plugin should now work with PHP4.
  • Updated jquery library to version 1.4.2.
  • Fixed root node identification, allowing users to style the root item with CSS.
  • Fixed bug that caused the expand icon to show for static pages that had no children.
1.6.2
  • Added CSS classes to page, anchor link, category and post titles and all root items allowing users to be easily override formatting.
  • The Summarizer can now use the anchor title for link summaries.
  • If the summary text is longer than the allowable character limit, the summarizer now adds ellipses to the end of the last word (it no longer truncates in the middle of a word). This results in a neater looking summary.
  • It is now possible to override any TOC option using parameters attached to the trigger tag. This allows multiple TOC lists to be displayed with different options (eg excluded blog cats, different icon sets etc).
  • Now dynamically removes open <p> tags before inserting the table of contents to ensure the TOCC plugin remain XHTML compliant.
  • Added option to allow sort by author (dynamically or by default).
  • Individual menu pull-down options can now be disabled by deleting the text after the comma within the Option Menu Item Texts setting.
  • Implemented hierarchial page and blog tree walking using a recursive algorithm for greater efficiency and reliability.
1.6.1
  • If no author URL is configured in the WP user section, the author link will default to the author post summary page.
  • Add Spanish (castilian) translation by Fernando J. Echevarrieta (echeva).
1.6.0
  • Hierarchial blog categories are now supported. An option has been included to display categories as a flat list as per previous versions.
  • New feature to dynamically display or hide child elements similar to the way Windows Explorer works.
  • New options menu allowing a visitor to hide/expand child elements, show/hide all summaries and sort the table of contents in several different orders.
  • Added ability to display page author and/or page date for static pages.
  • Updated Italian translation to include Summarizer options thanks to Carlo Politi.
  • Stripped Worpress caption tags and plugin square bracket activation tags from page and post summaries. This was causing Summarizer display porblems with caption tags and the contact form plugin.
  • Moved all tocc options into a single associative array resulting in smaller and easier to follow code with less calls to the option table.
  • The php code has now been fully commented.
  • The code used to generate the TOC HTML code has been completely rewritten. The resulting HTML is now a lot neater and no longer uses div elements. All list item types are now fully customizable using CSS. The lists are also now truely hierarchial.
  • Added a new classes to items with children, the active page item, date text, author text, expandable items and option menu items allowing greater flexibility when custom styling with css.
  • CSS file has been completely rewritten so that it is easier to override and customize.
  • Many function parameters are now passed by reference thus reducing overall memory requirements and CPU usage.
  • All formatting now moved from source code to the css file.
  • Added nonce and admin check to all TOCC administration panel settings changes (for security purposes).
1.5.1
  • Removed reliance on PHP5. Four lines of code accessed objects in a way that was not compatible with PHP4.
  • Added space between Summarizer option span elements to fix rendering issue with some browsers.
  • Added mozilla inline block replacement to fix rendering issues in Firefox 2.0 and lower.
  • Replaced text Summarizer icons with mostly transparent icons to best suit more background colors.
1.5
  • Brand new feature added – The Summarizer. This new feature allow you to display post or page summaries under each table of content item. The summaries are automatically generated using All in One SEO tags, post exceprts, body content or META tags. Summaries are displayed or hidden using fancy jQuery scroll effects. The Summarizer is also uber configurable. Readers may hide or display summaries using themed icons. BIG THANK YOU to Scott for suggesting this feature!
  • Fixed a small issue that stopped table of contents from correctly validating as XHTML.
  • Added an “Are you sure?” warning when the restore defautls button is selected.
  • Dynamically add toc.css and java script headers to pages with table of contents tag only (instead of all pages).
  • TOCC pages generated with the create page option are now add to the end of an ordered page list (position 9999). This ensures that the page is displayed last in most theme menus. Comments are also now closed by default.
1.4.4.1
  • Modified css file to remove CSS2 style bullets when displaying icons.
1.4.4
  • Fixed bug in tocc_plugin_options() function that stopped the admin page loading on some systems. Thank you very much Michael E. Chancey Jr. for pointing out the bug and offering a fix.
  • Added “Settings” link to plugin menu.
1.4.3
  • Fixed bug causing options to default to “blank” on initial install.
  • Fixed fault causing author acknowledgment to dispay at full text height.
  • Optimized use of WordPress actions. The plugin now loads the localization file only when needed and all global code has been removed (except for action hooks).
  • Resolved issue where default options would periodically not translate on new plugin install.
  • Added special debug mode (activated by typing DEBUG_ON in TOC Title) to output all option settings as a hidden comment on the TOC page.
  • Updated admin settings page to a more “WordPress” like theme.
1.4.2
  • Post anchor links now link to post permalink instead of the post number.
  • Added Italian language file by Carlo Politi.
  • Added Professional icon set (recommended by Bryan Brazil).
  • Changed IDs to CLASSES to ensure XHTML 1.0 Strict (thanks Bryan).
  • Added an uninstall script to remove all options when the plugin is deleted.
1.4.1
  • Removed translational strings from add_option_page function as I suspect this may cause a race condition on initial activation (ie after an upgrade) that may every now and again causes a momentary server failure message. The message goes away after refreshing the page.
  • Added CSS2 bullet clearing when displaying icons.
1.3.2
  • Modified internal English strings be i18n WordPress translation compatible.
  • Added translation “please help” message to the settings page.
1.4
  • Added option to select one of five different icon sets. Icons sets now include none, handdrawn (original), blue, square and bling. None selected by default, except when upgrading and show icons checkbox was selected. In this case, handdrawn is automatically selected to ensure that existing site maps retain the current look.
  • The settings page now utilises collapsible menues as the number of options was becoming too large and overwhelming to display all at once.
  • Added option (off by default) to show all entries as list items if not displaying icons. Currently only blog posts and forum comments are displayed as list items. Enabling this option allows easier integration into some themes.
  • Fixed display issues with IE6. Found bug in IE6 render engine that stopped the icons from being displayed if the list item consists entirely of an anchor tag. Added a space to the end of all list items fixes this bug. Thank’s Microsoft, can I have mny day back now?
  • Added option to display pages, posts and forum comments as separate lists each with individual headings. Heading texts can also be set.
  • Added option to display a “more” prompt at the end of the blog post and forum comments if not all of the posts or comments are shown. When clicked, the link will display a page of all posts or forum comments.
1.3.1
  • Post count now pulled from database as $cat->count does not match the number of posts pulled from the database in some (rare) cases.
  • Modified post retrieval query slightly as it sometimes got confused with posts that have multiple categories.
1.2.1
  • Renamed function display_posts to tocc_display posts and moved out of hook function as it conflicted with a function of the same name when display category posts. This update is a must for anyone using version 1.1 or 1.2 of this plugin!
1.3
  • get_posts() method used to retrieve wordpress blog posts sometimes return incorrect (empty) results. I have therefore implemented a new method to directly retrieve posts from the database. Retrieval falls back to get_post if no posts were found using the database method.
  • Removed bullets from forum comments and blog posts when displaying icons.
  • Hardcoded title formatting removed and added by default to the title. A blank title tag is now also allowed.
  • Additional desscriptions added to settings page to guide users on the use of the create page and update options buttons.
  • Added options to show blog and forum last update date and author.
  • Added date format specifier for blog and forum last update dates.
  • Added forum and blog author prefix text setting (for blogs using a language other than English)
  • Added forum and blog warning text setting (for blogs using a language other than English)
  • Added optional formatting to CSS file (such as removing bullets, adding anchor decoration etc). Instructions included in the CSS file.
  • Added ability to determine previous version during upgrade. This will allow future versions to tweak existing settings to match the look and functionality of previous versions.
1.2
  • Modified default settings to disable icons and show all blog entries (looks more professional).
  • Now shows blog entries as list items if icons are not selected. This provides better intergration with existing site themes and looks better when icons are not displayed.
  • Now uses configurable blog title if not displaying static pages. The blog title may be left blank.
  • Removed excessive use of nested &ltdiv&gt tag. This may have caused an issue with oulder browsers.
  • Now ensure blog posts are sorted by date rather than rely on WordPress defaults (as this may change in later WordPress versions).
  • Split the show posts/comments warning option into individual forum and blog sections.
  • New option (on by default) to show total number of posts in each category.
1.1
  • Posts will now be displayed if there is no static post page. Prior to this release, a static blog page was required.
  • Now shows blog entries if blog page or static pages are excluded from the table of contents.
  • Now show forum comments if forum page or static pages are excluded from the table of contents.
  • Added option to remove author acknowledgment.
  • Now displays a message indicating the last number of posts if the number of posts exceeds the selectable maximum number of displayed posts.
  • Now displays a message indicating the latest number of forum comments.
  • Fixed incorrect <div> nesting when static pages are excluded.
  • Fixed bug where anchor links would be displayed even though static pages were disabled.
  • Fixed bug where forum page would always default back to the first page in the settings editor.
  • Now allow extended help to be displayed if the option is disabled. This my be help the user to determine why the option is disabled in the first place.
1.0
  • Initial public release.

Upcoming Features

The following is a list of features that will be implemented in the next revsion. If you would like any additional features, please feel free to leave a comment below.

  • Add option to only show sub pages of the current page within the TOC. This will be handy for using the sidebar widget as a dynamic menu.
  • Add option for maximum number of links per page (split list over multiple pages) – toc pagination.
  • Allow sort by user defined tag.
  • Allow text instead of icons for summary (eg `show` or `hide`) if no icon summary selected.
  • Integrate FAQs and preprocessor help with the WordPress Help system (the help pulldown on the settings page).

Acknowledgements

I wish to acknowledge the valuable assistance offered by the following people:

  • Carlo Politi for providing and updating the Italian translation file.
  • Fernando J. Echevarrieta (echeva) for providing the Spanish (Castilian) translation file.
  • Scott for suggesting and helping test the new Summarizer feature.
  • Steadman Uhlich for assisting with major version pre-release testing and vailidation’, ‘tocc’)
  • Txia for providing the French translation file.
  • HamidReza Kazemi for providing the Persian translation file.

Please help. Your help would be greatly appreciated if you could assist in translating this plugin, help test new releases or suggest new features.

Comments

Please let me know what you think. Leave a comment if you have a requested feature, found a bug or need some help. All are welcome.

264 Responses to “Table of Contents Creator”

  1. Jim 25 June 2010 at 4:17 am #

    Sorry if I’m bothering you Mark, but I noticed the latest release has ‘includes.’ Is there any way I can utilize that capability to automatically show all sub-pages as well, or must I explicitly name those IDs as well?

    I’m trying to generate a collapsing list of pages and sub-pages with excerpts depending on the page I’m on.

    Thanks.

    • Mark 2 July 2010 at 6:06 pm #

      Hi Jim,
      I apologize for the late reply, I took a “holiday” away from my PC for a while. Unfortunately this feature is not available in the current version. I will make sure it is in the next. Please let me know if you need it straight away as I may be able to send you a development version.
      PS: Don’t worry about bothering me :)
      Mark.

      • Jim 10 July 2010 at 6:47 pm #

        Thanks man. I’m not in a hurry for it, but I could get rid of some other sub-page plug-ins if your much more capable plug-in can do this!

        BTW, I’ve noticed that if a top level category is empty, the Table of Contents does not print it nor its children, even if the categories below it are filled with posts. Is that by design? If so, I will think up a post for some of the general category headings…

  2. Jamie 23 June 2010 at 7:55 am #

    Hi,
    Wonderful plug-in – I am voting for it ;-)

    I noticed that in the admin settings page near the top it says to insert the code BUT it is missing the !

    Might confuse people who are not having the page “created” for them.
    Good work!
    Jamie

    • Mark 2 July 2010 at 6:05 pm #

      Thanks for the vote Jamie. I will make sure this is fixed for the next release. Thanks for letting me know.
      Mark.

  3. Bruce 22 June 2010 at 5:51 pm #

    Great plugin Mark!

    It works well on any of my pages. But it doesn’t seem to work on the category description field ie Posts > Categories > Edit > Description.

    Any ideas on how to get this to work as I want to do a toc for each category?.

    • Mark 2 July 2010 at 6:04 pm #

      Sorry for the late response. Been away from the PC for a while. What you say is a bit odd. It works on all my test sites (this one included). Can you please let me know if under TOCC Blog Post Options, you have Flat list ticked or not. Also, can you please tell me which site you are trying this on so that I can have a look and see whether I can spot anything. Finally, letting me know what theme you are using would also be handy.
      Thanks,
      Mark.

  4. Sasha 13 June 2010 at 6:51 am #

    Hi, great plugin, but I , too need to translate it … into Greek, and of course I’ll send it on to you when done. COuld you please send on the .po file?!
    Thanks

    • Mark 14 June 2010 at 5:07 am #

      Thank you Sasha for your very kind offer of help. I have sent a POT file and some instructions to your supplied email address. If you have any inquiries during the conversion process, please do not hesitate to contact me.
      Cheers,
      Mark.

  5. hamidreza 6 June 2010 at 8:52 am #

    Hi, thanks u for this useful plugin, just is it possible to send me .PO file , i need to translate it into my language(Persian) tnx

    • Mark 11 June 2010 at 7:16 pm #

      Thank you Hamid for your very kind offer. I have sent the POT file and instructions to your specified email address. I greatly appreciate people like yourself who are willing to spend a couple of hours of your own time to help make this plugin more accessible to non-english speaking countries. Thank you. Mark.
      PS: Contact me any time should you have any questions on the conversion process.

  6. enad 5 June 2010 at 4:48 am #

    nice plugin. but i’ve been using for a toc plugin that will just show alphabetically, from A-Z, like an index page. but not to show them by category then alphabetically. is there a way to do it using your plugin?

    ill greatly appreciate your prompt response.

    • Mark 5 June 2010 at 4:10 pm #

      Hi enad, I’ll add an option to do this. I’m trying to release a new version today, so hopefully you will not have to wait long. Mark.
      [Edit] Oops, I forgot that I had already included this. Within the TOCC settings page, set the “Default Sort Order” to “Alphabetical” within the General Options pane. Then expand the Blog Post Options pane and enable the “Don’t Show Categories” option.

  7. Mark 1 June 2010 at 3:32 am #

    The following message was left by Eric using the contact form. Unfortunately there was a typo in the email address, and I could not reply. I’ve listed it here JIC Eric reads the comments…

    Hi:

    I tried to activate your beautiful TABLE OF CONTENTS CREATOR to run in a sidebar, but it didn’t work for me.

    I went to you site and it looks like it needs to be a widget specifically developed for the sidebar.

    is this true?

    Looks like you create great products. I will definitely be looking at your other creations.

    I am not a fluent code write, but a visual designer learning to hack his way around.

    Thanks,
    Eric
    in West Seattle

    • Mark 1 June 2010 at 3:33 am #

      Hi Eric,

      Not sure whether this will work, but you could try this…

      1) Install the “Executable PHP widget” widget.
      2) Add a text box widget and in the text box type “” (without the quotes).

      Please let me know whether this works for you. If not, I’ll try and quickly knock something up.
      Mark.

  8. Kenneth 31 May 2010 at 4:35 pm #

    Hi, I used this plugin it works fine only I’ve got an duplciate meta tag and pages with duplicate meta description in g master tools. Here’s the sample below

    Duplicate Meta Tag
    /site-map/?toc_order=2
    /site-map
    /site-map?toc_order=1

    Pages with duplicate meta description
    /site-map/?toc_order=1
    /site-map/?toc_order=2
    /site-map
    /site-map?toc_order=1

    Please help.

    Thanks

    • Mark 1 June 2010 at 2:54 am #

      Hi Kenneth,

      Thanks for using my plugin. The duplicate meta description and meta tag warnings are perfectly OK. The pages you list are actually all the same page with different URL parameters. Basically, the ? is used to separate the page location and the parameters, with multiple parameters linked together with the & symbol. For example, type a search term into google and hit the search button and you’ll see some URL parameters in the address bar.

      To disable this warning, you need to tell Google (and other search engines) not to crawl these pages. The easiest way to do this is to install the iRobots.txt SEO plugin. Once installed, click settings and expand the Advanced Configuration pane. Type “*” (without the quotes) in the User Agent section and type “/*?toc_*” (without the quotes) after the disallow drop down box, then click Update Record. This will disallow all TOCC parameter pages from being crawled. There is more info on iRobots.txt SEO here.

      Hope this helps,
      Mark.

  9. Jim 30 May 2010 at 6:20 pm #

    Mark, as the writer of one of the most helpfully conceived plug-ins for WordPress, I humbly suggest you may be interested in enjoining the discussion on utilizing wp_enqueue-scrpt (_) at Beer Planet.

    It is an interesting take on plug-ins. Plug-ins are often preferable to hard coding since they span themes. Unfortunately plug-ins quickly degrade WordPress performance and many users are forced to limit their use to a woeful few since speed is the all consuming prerequisite of any website.

    • Mark 1 June 2010 at 2:58 am #

      Plugins do degrade performance, however if they are written correctly they should only run when required. If one installs many plugins that generate content, such as the one here, I highly recommend investigating WP Super Cache or something similar. This will serve a static version of the page and only run the PHP code once every now and again. This should offset any degradation caused by the plugin.

  10. Jim 25 May 2010 at 2:59 am #

    Beautifully conceptualized and configured plug-in. Wow.

    I wonder if you realize that you have produced more than a table of contents or site map. If you add the option to print any combination of equal level pages (to the current one) and/or sub-pages to any level, you would have produced the perfect plug-in not only for archives, but for producing a full fledged CMS system.

    And yes, I realize one could manually exclude all the pages, but in a larger web site that becomes tedious.

    Since your plug-in allows placing it anywhere on a page, it would be highly configurable, allowing text, tables, images and video along with the sub-pages or categories.

    I especially like that the plug-in uses code that degrades. I wish all plug-ins which use shortcode would stop using the [brackets].

    Thanks again. Beautiful work.

    • Mark 26 May 2010 at 1:22 am #

      Thanks Jim. I’ll include your suggestion in the next release.
      Mark

      • Jim 30 May 2010 at 6:02 pm #

        A seminole plug-in Mark. Great work.

      • Mark 1 June 2010 at 2:59 am #

        Thanks Jim :)

  11. TechGyo 24 May 2010 at 1:16 pm #

    Great plugin to reduce bounce rate. Thanks a lot. I’ve thinking how to reduce bounce rate!!

    Thanks again!!

  12. Martin 19 May 2010 at 12:40 am #

    Hi Mark,

    I am really glad I have finally found your great plugin.
    Nevertheless, would you be so kind and help me to sort one problem out, please?
    As you can see there is an upper list of Sections (such as Alchymie, Astrologie, Hermetismus, Kabala…) where you plugin works well by using your trigger tag [ a da capo].
    But I was not able to set up it for the following pages that have subsections such as MAGIE (cat=12) with cats 18,19,20; the same for RECENZE (cat=35) with cats 3,36,37, and REVUE HORUS (cat=28) with one subsection only (for the time being) cat=29.
    Where is no subsection then it works perfectly.
    Here I tried many options but nothing worked at all.
    Help, please!
    Thanking you in advance.
    Martin

    • Mark 21 May 2010 at 12:02 am #

      Hi Martin,
      In the TOC settings pane, have you tried ticking the “Show as Flat List” option under “Blog Post Options”? This may fix the problem. If not, can you please send me a link to your TOC page and I’ll do some investigations.
      Thanks,
      Mark.

      • Martin 9 June 2010 at 1:08 am #

        It DOES work!
        Fantastic!
        Many thanks for your help, Mark!
        :-)
        Martin

  13. stanlaurent 14 May 2010 at 5:01 am #

    hello, categories can not be collapse it by default?
    then people will click depending on what interests them.
    Thanks for your work – good plugin

    • Mark 14 May 2010 at 5:01 pm #

      Hi Stanlaurent,
      Within the TOC settings page, select the “Hide Children by Default” option. This will collapse all posts within the categories by default.
      Hope this helps,
      Mark.

  14. Rose Vines 29 April 2010 at 5:08 am #

    Wow, the 1.6.3 update is terrific. It gave me everything I wanted and some things I didn’t realise I wanted. :-)

    Thanks so much for your work.

    • Mark 29 April 2010 at 10:31 pm #

      Thanks Rose.

  15. Stretch 24 April 2010 at 10:45 am #

    I can’t believe what a bonehead I am! After you so kindly fixed my unique problem at http://exerciseinformant.com , I, completely without thinking, hit the upgrade button for the new update… now I am back to the original problem. Is there a way to go back to the previous version? I looked all over but couldn’t find an “undo”. I replaced the old theme with a brand new one that I created and I updated the plugin before I looked to see if tocc was working, so, I’m not even sure which one screwed it up. I’m sooo sorry to be a pain in the ass : (
    PS. It must be something with this site because I swapped themes on all the other sites and tocc works beautifully… but now I’m afraid to update those. Let me know what you think, Thanks

    • Mark 24 April 2010 at 5:49 pm #

      Hi Stretch :)
      It is possible to downgrade TOCC by going here… http://wordpress.org/extend/plugins/table-of-contents-creator/. Click the “Other versions” link and download the version you require. Then under plugins (on your site), you can upload the zip file.
      However, if a previous version of TOCC works without modification, you can upgrade as I test this process thoroughly.
      When I look at your sitemap page on excerciseinformant, I notice that the tocc tag is not properly formed. To see what I mean, navigate to your page in Firefox, right click and select view source. Search for toc-creator. Note that the comment dashes are shown as one long dash. The comment line above is shown correctly. You need firefox as Chrome shows it correctly.
      Did you copy and paste the short tag into your blog, or did you use the page creation feature? May I suggest deleteing the tag and manually retyping it (making sure you select the HTML tab in the edit form) ie <--! toc-creator -->
      Wordpress has a very annoying habbit of turning two dashes into one long dash and wrapping everything in paragraph tags.
      Mark.

      • Stretch 25 April 2010 at 10:35 pm #

        You’ve done it again! Thanks, I retyped it, and even though the code page showed double dashes, it did look differently and it worked! I promise I’ll never touch it again : )
        Very Grateful for your plugin and all your help!

      • Mark 25 April 2010 at 10:57 pm #

        I’m glad it is working. I should have spotted that last time I looked at the problem. Oh well. Your site is now very colorful… I really like the main landing page montage thingy :)
        BTW in the TOCC settings pane you can select the color code for the option pulldown menu borders. I note that you are using the default colors which clash with your color scheme.
        Cheers,
        Mark.

  16. Raz 16 April 2010 at 8:25 am #

    Mark, your TOCC is great. But I’ve some suggestions 2 make:

    1) How about a TOC link at the top 2 go back 2 the table of content page?

    2) By default your plugin displays “Uncategorised”.
    Can this be removed? I mean I am not interested in categories. I do not want my TOC to be based on categories.

    • Mark 16 April 2010 at 6:13 pm #

      Hi Raz,
      Thank you for your suggestions.
      1) Can you explain this some more? I’m not sure what you mean. Can you please provide an example??
      2) This is an interesting suggestion. So what you are saying is that you want to display all your posts within one big list, not separated by categories. I’ll add this to the to do list and include an option in the next release.
      Thanks again,
      Mark.

  17. Stacy 9 April 2010 at 9:08 pm #

    I love this plugin and thanks for making it…was just having one small problem on my site with not being able to expand or collapse individual categories. Everything will expand or collapse from the options link, but the little sideways triangle thingy that is supposed to be next to the category icon is missing…I’m very nooby. This works fine on 2 other websites I have. Maybe you have an idea what I can do to fix this? Thanks :)

    • Mark 16 April 2010 at 6:32 pm #

      Hi Stacy.

      Sorry for the late reply. Somehow your comment ended up being moved into the spam folder. I get close to 50-100 spam comments every day, so it was by pure fluke that I noticed your comment.

      OK. I checked your site and everything looks fine. Your page source code displays the expand icon span in the correct places, the CSS file exists, the expand_icon png file exists and no other CSS files appear to be using the expand_icon class.

      There are to things that are probably worth a try:
      1) In the tocc.css file (you can get to this by clicking on the edit link next to the plugin listing in the plugin section of the admin panel), add ” !important” (without the quotes, but with the leading space) before the semi-colon next to all CSS listings between “#tocc .expand_icon {” (but not this line) and the next closing curly-bracket (}).
      eg. The first edited line should look like this “cursor:pointer !important;”

      2) If the above does not work, try modify the line “margin-left:-47px;” to something like “margin-left:5px;”. If this works, you may need to fool around with the number a little bit to put the arrow in the correct location.

      If none of the above work, please contact me again and we can try some other things.

      Thanks,
      Mark.

  18. Mark 2 April 2010 at 12:45 am #

    Stretch…for some reason, whenever I reply to your comments, they don’t show up on the page????

    I spent more than an hour looking into your problem and replied 27/3 with some things I would like you to try to help find the problem. I’ve reposted below…

    Submitted on 2010/03/27 at 4:41am
    I’m really sorry Stretch. I am extremely time poor at the moment. I”ll look at the problem right now.

    [EDIT] I tested the plugin with FreePort theme, PHP5 and Wordpres 2.9.2. It worked. Still looking…

    [EDIT] I checked out your sitemap page. It definately has the toc tag. It is as if something in the theme, or another plugin is stopping the ‘the_content’ hook from running. Looking further…

    [EDIT] Can’t find anything wrong. We unfortunately need to dig a little deeper. Can you please do me a small favour…

    In the wp-admin page, “Editor” from the Plugin menu. In the “Select Plugin to Edit” pulldown, select “Table of Contents Creator” and press the “Select” button and then click on the php filename.

    Search for “function tocc_display_hook” and temporarily add the following line immediately below the function call…

    print_r(“TOC Running<br />”);

    and finally press the “Update File” button.

    This should add some text to the top of every page and every post. Please let me know if this works. If it does, the problem is with the REGEX expression. If it doesn’t, the problem is with the hook. Either way, it will be easier to fix when we know which one is causing the fault.

    Cheers,
    Mark.

  19. Andrew Tate 1 April 2010 at 2:20 am #

    Great plugin!
    Nice and easy to use and provides a usable end product.

    I would like to do a bit more with it though as some of the static pages I have created are just top level locators for sub pages or links to none wordpress pages or content. Is the control in there and I am missing it?

    For instance if you look at my site http://www.online-turf.co.uk you will see that the menu item “BARK & MULCH” is not linked but it has three children that are. I have no follows on the main page for spiders as it has no content.

    I have tried using the exclude on your settings page but it takes out the children as well.

    Is there any way around this?

    • Mark 2 April 2010 at 1:01 am #

      Hi Andrew. Unfortunately this is not possible with the current version. Will an option that excludes adding the hyperlink to certain pages suffice? I can easily add this to the next release. I introduced tag options to the current version. As this option will not be required by many users, will you be happy if I don’t add this option to the actual admin settings page, but allow an override on the tag (eg you may need to call the plugin using a command like <!– toc-creator @page_link_exclude=32,46,29 –> where the numbers represent the page IDs)?

      • Andrew Tate 2 April 2010 at 3:00 am #

        Mark
        The option to exclude the hyperlink would be great.
        I am using a workaround at the moment with a redirect plugin so that visitors don’t see the blank parent page at the moment, but I don’t know if this will effect SEO.

        I eagerly await any updates.

        Once again thanks for the great plugin you have created.

      • Mark 3 April 2010 at 3:52 am #

        Time is limited at the moment, but I’ll try to release the next rev some time next week. I wouldn’t worry about affecting your SEO if you have configured a permanent redirect.

        [EDIT] This feature is now included in release 1.6.3.

  20. Rose Vines 31 March 2010 at 10:46 am #

    Thanks for this spectacularly good addition to WordPress, Mark. Not only is it exactly what I’ve been looking for, but your design is so elegant, you’ve paid so much attention to detail and – astoundingly! – you’ve provided such lucid documentation that it’s a delight to use.

    One suggestion: How about an option that lets us insert a paragraph of help/intro text immediately below the TOC title?

    You can see an example on my site at http://www.geekgirls.com/articles/article-index/. I fudged this by sticking the intro text into the Table of Contents Title field, but it’d be much better if this were an option. In fact, it’d be handy to have such an intro paragraph option after each title (TOC, Static pages, Blog posts). Or am I missing something already present?

    Because my site is all about helping people use technology, I’m a fanatic about providing clear instructions. Having this option would help people tailor the TOC to their readership.

    • Mark 2 April 2010 at 1:12 am #

      Thank you Rose for the very kind words.

      You can currently do what you ask for, but it is a bit of a fudge. If you leave the TOC title blank, you can add whatever text you like before calling the TOC short tag. This is also possible for separate lists (pages, posts & comments) using multiple TOC short tags. eg…

      <h1>Table of Contents</h1>
      <p>blah blah</p>
      <h2>Pages</h2>
      <p>blah blah</p>
      <!– toc-creator show_blog= –>
      <h2>Posts</h2>
      <p>blah blah</p>
      <!– toc-creator show_pages= –>

      I could add a help icon to the right of the option menu to make this easier. This would display text (settable via the admin page) when it is clicked. Would this suffice?

      Cheers,
      Mark.

      • Rose Vines 6 April 2010 at 2:37 pm #

        Yes, that would suffice, Mark. :-)

      • Mark 24 April 2010 at 5:54 pm #

        This feature is now included in release 1.6.3.


Trackbacks/Pingbacks.

Leave a Reply


SpinChimp Leaderboard 728x90