Page TOC Generator
Votes: 14
Tags: Navigation, Menu, plugin
Submitted: Dec 3, 2007
Released: Dec 3, 2007
Downloads: 356
License: GPL - GNU Public
Page TOC Generator 0.90
Works with the following Version(s): 0.9.5 | 0.9.6
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable.
Download
- repo-1722.txt (356 downloads)
Description
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable. It creates a list (<ul> or <ol>) of links to the headings within that page. It automatically generates the anchors, so you just have to create the headings. It's a site-wide plugin, so it's easy to put a "Page Contents" feature on any page on your site.
Instructions
### INSTALLATION: ###
1. Create a new Plugin called "Page TOC Generator".
2. Paste in the PHP code of this file.
3. Go to the "System Events" tab
4. Check the box in front of "OnWebPagePrerender"
### HOW TO USE: ###
1. Create a page in MODx as usual
2. Add appropriate headings on that page to divide up the sections of the page into a sort of outline
3. In the HTML code of that page, add the configuration parameters (see below -- these look like normal HTML comments, but are parsed by the plugin).
4. Put the <!--#toc_plugin#_START_TOC_INDEXING--> tag at the spot where you want to begin indexing the page's headings.
5. Put the <!--#toc_plugin#_END_TOC_INDEXING--> tag where you want the indexing to stop.
6. Put the <!--#toc_plugin#_TOC_OUTPUT--> tag where you want the table of contents to show up.
### CONFIGURATION PARAMETERS: ###
<!--#toc_plugin#_START_CONFIGURATION--> (optional)
<!--#toc_plugin#_list_type=ul--> sets the list type (ul/ol).
<!--#toc_plugin#_start_level=1--> Sets the starting heading level (h1-h6).
<!--#toc_plugin#_end_level=2--> Sets the ending heading level (h1-h6).
<!--#toc_plugin#_header=Page Contents--> Sets the text of the heading for table of contents.
<!--#toc_plugin#_header_tag=h2--> Sets the tag which encloses the heading (could be a heading, <p>, <div>, etc.
<!--#toc_plugin#_parent_tag=div--> Sets the parent tag which encloses table of contents. you can leave it blank.
<!--#toc_plugin#_parent_tag_id=toc--> Sets the CSS id which is applied to the parent tag.
<!--#toc_plugin#_END_CONFIGURATION--> (optional)
### SAMPLE USAGE: ###
<!--#toc_plugin#_START_CONFIGURATION-->
<!--#toc_plugin#_list_type=ul-->
<!--#toc_plugin#_start_level=2-->
<!--#toc_plugin#_end_level=3-->
<!--#toc_plugin#_header=Page Contents-->
<!--#toc_plugin#_header_tag=h2-->
<!--#toc_plugin#_parent_tag=div-->
<!--#toc_plugin#_parent_tag_id=toc-->
<!--#toc_plugin#_END_CONFIGURATION-->
<!--#toc_plugin#_TOC_OUTPUT-->
<!--#toc_plugin#_START_TOC_INDEXING-->
<h2>Here is a heading</h2>
<p>Here is some text</p>
<h2>Here is another heading</h2>
<h3>Here is a subheading</h3>
<h3>Here is another subheading</h3>
<!--#toc_plugin#_END_TOC_INDEXING-->
### EXPECTED OUTPUT: ###
<div id="toc">
<h2>Page Contents</h2>
<ul>
<li><a href="#Here is a heading_1">Here is a heading</a></li>
<li><a href="#Here_is_another_heading_2">Here is another heading</a>
<ul>
<li><a href="#Here_is_a_subheading_3">Here is a subheading</a></li>
<li><a href="#Here_is_another_subheading_4">Here is another subheading</a></li>
</ul>
</li>
</ul>
</div>
<h2><a name="Here is a heading_1" id="Here is a heading_1"></a>Here is a heading</h2>
<p>Here is some text</p>
<h2><a name="Here_is_another_heading_2" id="Here_is_another_heading_2"></a>Here is another heading</h2>
<h3><a name="Here_is_a_subheading_3" id="Here_is_a_subheading_3"></a>Here is a subheading</h3>
<h3><a name="Here_is_another_subheading_4" id="Here_is_another_subheading_4"></a>Here is another subheading</h3>
UpdatesMore robust handling of header parsing.
Sub-Packages
Previous Releases
0.9.2
Votes: 13
Tags: Navigation, Menu, plugin
Submitted: Dec 8, 2007
Released: Dec 8, 2007
Downloads: 456
License: GPL - GNU Public
Page TOC Generator 0.9.2
Works with the following Version(s): 0.9.5 | 0.9.6
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable.
Download
- repo-1731.txt (456 downloads)
Description
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable. It creates a list (<ul> or <ol>) of links to the headings within that page. It automatically generates the anchors, so you just have to create the headings. It's a site-wide plugin, so it's easy to put a "Page Contents" feature on any page on your site.
Instructions
### INSTALLATION: ###
1. Create a new Plugin called "Page TOC Generator".
2. Paste in the PHP code of this file.
3. Go to the "System Events" tab
4. Check the box in front of "OnWebPagePrerender"
### HOW TO USE: ###
1. Create a page in MODx as usual
2. Add appropriate headings on that page to divide up the sections of the page into a sort of outline
3. In the HTML code of that page, add the configuration parameters (see below -- these look like normal HTML comments, but are parsed by the plugin).
4. Put the <!--#toc_plugin#_START_TOC_INDEXING--> tag at the spot where you want to begin indexing the page's headings.
5. Put the <!--#toc_plugin#_END_TOC_INDEXING--> tag where you want the indexing to stop.
6. Put the <!--#toc_plugin#_TOC_OUTPUT--> tag where you want the table of contents to show up.
### CONFIGURATION PARAMETERS: ###
<!--#toc_plugin#_START_CONFIGURATION--> (optional)
<!--#toc_plugin#_list_type=ul--> sets the list type (ul/ol).
<!--#toc_plugin#_start_level=1--> Sets the starting heading level (h1-h6).
<!--#toc_plugin#_end_level=2--> Sets the ending heading level (h1-h6).
<!--#toc_plugin#_header=Page Contents--> Sets the text of the heading for table of contents.
<!--#toc_plugin#_header_tag=h2--> Sets the tag which encloses the heading (could be a heading, <p>, <div>, etc.
<!--#toc_plugin#_parent_tag=div--> Sets the parent tag which encloses table of contents. you can leave it blank.
<!--#toc_plugin#_parent_tag_id=toc--> Sets the CSS id which is applied to the parent tag.
<!--#toc_plugin#_END_CONFIGURATION--> (optional)
### SAMPLE USAGE: ###
<!--#toc_plugin#_START_CONFIGURATION-->
<!--#toc_plugin#_list_type=ul-->
<!--#toc_plugin#_start_level=2-->
<!--#toc_plugin#_end_level=3-->
<!--#toc_plugin#_header=Page Contents-->
<!--#toc_plugin#_header_tag=h2-->
<!--#toc_plugin#_parent_tag=div-->
<!--#toc_plugin#_parent_tag_id=toc-->
<!--#toc_plugin#_END_CONFIGURATION-->
<!--#toc_plugin#_TOC_OUTPUT-->
<!--#toc_plugin#_START_TOC_INDEXING-->
<h2>Here is a heading</h2>
<p>Here is some text</p>
<h2>Here is another heading</h2>
<h3>Here is a subheading</h3>
<h3>Here is another subheading</h3>
<!--#toc_plugin#_END_TOC_INDEXING-->
### EXPECTED OUTPUT: ###
<div id="toc">
<h2>Page Contents</h2>
<ul>
<li><a href="#Here is a heading_1">Here is a heading</a></li>
<li><a href="#Here_is_another_heading_2">Here is another heading</a>
<ul>
<li><a href="#Here_is_a_subheading_3">Here is a subheading</a></li>
<li><a href="#Here_is_another_subheading_4">Here is another subheading</a></li>
</ul>
</li>
</ul>
</div>
<h2><a name="Here is a heading_1" id="Here is a heading_1"></a>Here is a heading</h2>
<p>Here is some text</p>
<h2><a name="Here_is_another_heading_2" id="Here_is_another_heading_2"></a>Here is another heading</h2>
<h3><a name="Here_is_a_subheading_3" id="Here_is_a_subheading_3"></a>Here is a subheading</h3>
<h3><a name="Here_is_another_subheading_4" id="Here_is_another_subheading_4"></a>Here is another subheading</h3>
Updates* Added default values, so you don't have to specify them on each page
* Made the markers customizable, so you can use your own
* Changed regular expression replace to string replace for final step
0.76
Votes: 13
Tags: Navigation, Menu, plugin
Submitted: Feb 26, 2007
Released: Feb 26, 2007
Downloads: 691
License: GPL - GNU Public
Page TOC Generator 0.76
Works with the following Version(s): 0.9.5
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable.
Download
- repo-1345.txt (691 downloads)
Description
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable. It creates a list (<ul> or <ol>) of links to the headings within that page. It automatically generates the anchors, so you just have to create the headings. It's a site-wide plugin, so it's easy to put a "Page Contents" feature on any page on your site.
Instructions
### INSTALLATION: ###
1. Create a new Plugin called "Page TOC Generator".
2. Paste in the PHP code of this file.
3. Go to the "System Events" tab
4. Check the box in front of "OnWebPagePrerender"
### HOW TO USE: ###
1. Create a page in MODx as usual
2. Add appropriate headings on that page to divide up the sections of the page into a sort of outline
3. In the HTML code of that page, add the configuration parameters (see below -- these look like normal HTML comments, but are parsed by the plugin).
4. Put the <!--#toc_plugin#_START_TOC_INDEXING--> tag at the spot where you want to begin indexing the page's headings.
5. Put the <!--#toc_plugin#_END_TOC_INDEXING--> tag where you want the indexing to stop.
6. Put the <!--#toc_plugin#_TOC_OUTPUT--> tag where you want the table of contents to show up.
### CONFIGURATION PARAMETERS: ###
<!--#toc_plugin#_START_CONFIGURATION--> (optional)
<!--#toc_plugin#_list_type=ul--> sets the list type (ul/ol).
<!--#toc_plugin#_start_level=1--> Sets the starting heading level (h1-h6).
<!--#toc_plugin#_end_level=2--> Sets the ending heading level (h1-h6).
<!--#toc_plugin#_header=Page Contents--> Sets the text of the heading for table of contents.
<!--#toc_plugin#_header_tag=h2--> Sets the tag which encloses the heading (could be a heading, <p>, <div>, etc.
<!--#toc_plugin#_parent_tag=div--> Sets the parent tag which encloses table of contents. you can leave it blank.
<!--#toc_plugin#_parent_tag_id=toc--> Sets the CSS id which is applied to the parent tag.
<!--#toc_plugin#_END_CONFIGURATION--> (optional)
### SAMPLE USAGE: ###
<!--#toc_plugin#_START_CONFIGURATION-->
<!--#toc_plugin#_list_type=ul-->
<!--#toc_plugin#_start_level=2-->
<!--#toc_plugin#_end_level=3-->
<!--#toc_plugin#_header=Page Contents-->
<!--#toc_plugin#_header_tag=h2-->
<!--#toc_plugin#_parent_tag=div-->
<!--#toc_plugin#_parent_tag_id=toc-->
<!--#toc_plugin#_END_CONFIGURATION-->
<!--#toc_plugin#_TOC_OUTPUT-->
<!--#toc_plugin#_START_TOC_INDEXING-->
<h2>Here is a heading</h2>
<p>Here is some text</p>
<h2>Here is another heading</h2>
<h3>Here is a subheading</h3>
<h3>Here is another subheading</h3>
<!--#toc_plugin#_END_TOC_INDEXING-->
### EXPECTED OUTPUT: ###
<div id="toc">
<h2>Page Contents</h2>
<ul>
<li><a href="#Here is a heading_1">Here is a heading</a></li>
<li><a href="#Here_is_another_heading_2">Here is another heading</a>
<ul>
<li><a href="#Here_is_a_subheading_3">Here is a subheading</a></li>
<li><a href="#Here_is_another_subheading_4">Here is another subheading</a></li>
</ul>
</li>
</ul>
</div>
<h2><a name="Here is a heading_1" id="Here is a heading_1"></a>Here is a heading</h2>
<p>Here is some text</p>
<h2><a name="Here_is_another_heading_2" id="Here_is_another_heading_2"></a>Here is another heading</h2>
<h3><a name="Here_is_a_subheading_3" id="Here_is_a_subheading_3"></a>Here is a subheading</h3>
<h3><a name="Here_is_another_subheading_4" id="Here_is_another_subheading_4"></a>Here is another subheading</h3>
UpdatesAttributes are now allowed in heading tags.
Fixed bugs with headings that have punctuation and special characters (question marks, apostrophes, etc)
0.7
Votes: 13
Tags: Navigation, Menu, plugin
Submitted: Jan 20, 2007
Released: Jan 20, 2007
Downloads: 670
License: GPL - GNU Public
Page TOC Generator 0.7
Works with the following Version(s): 0.9.5
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable.
Download
- repo-1276.zip (670 downloads)
Description
Automatically generate a page-specific table of contents from the page's headings. Configurable, stylable. It creates a list (<ul> or <ol>) of links to the headings within that page. It automatically generates the anchors, so you just have to create the headings. It's a site-wide plugin, so it's easy to put a "Page Contents" feature on any page on your site.
Instructions
### INSTALLATION: ###
1. Create a new Plugin called "Page TOC Generator".
2. Paste in the PHP code of this file.
3. Go to the "System Events" tab
4. Check the box in front of "OnWebPagePrerender"
### HOW TO USE: ###
1. Create a page in MODx as usual
2. Add appropriate headings on that page to divide up the sections of the page into a sort of outline
3. In the HTML code of that page, add the configuration parameters (see below -- these look like normal HTML comments, but are parsed by the plugin).
4. Put the <!--#toc_plugin#_START_TOC_INDEXING--> tag at the spot where you want to begin indexing the page's headings.
5. Put the <!--#toc_plugin#_END_TOC_INDEXING--> tag where you want the indexing to stop.
6. Put the <!--#toc_plugin#_TOC_OUTPUT--> tag where you want the table of contents to show up.
### CONFIGURATION PARAMETERS: ###
<!--#toc_plugin#_START_CONFIGURATION--> (optional)
<!--#toc_plugin#_list_type=ul--> sets the list type (ul/ol).
<!--#toc_plugin#_start_level=1--> Sets the starting heading level (h1-h6).
<!--#toc_plugin#_end_level=2--> Sets the ending heading level (h1-h6).
<!--#toc_plugin#_header=Page Contents--> Sets the text of the heading for table of contents.
<!--#toc_plugin#_header_tag=h2--> Sets the tag which encloses the heading (could be a heading, <p>, <div>, etc.
<!--#toc_plugin#_parent_tag=div--> Sets the parent tag which encloses table of contents. you can leave it blank.
<!--#toc_plugin#_parent_tag_id=toc--> Sets the CSS id which is applied to the parent tag.
<!--#toc_plugin#_END_CONFIGURATION--> (optional)
### SAMPLE USAGE: ###
<!--#toc_plugin#_START_CONFIGURATION-->
<!--#toc_plugin#_list_type=ul-->
<!--#toc_plugin#_start_level=2-->
<!--#toc_plugin#_end_level=3-->
<!--#toc_plugin#_header=Page Contents-->
<!--#toc_plugin#_header_tag=h2-->
<!--#toc_plugin#_parent_tag=div-->
<!--#toc_plugin#_parent_tag_id=toc-->
<!--#toc_plugin#_END_CONFIGURATION-->
<!--#toc_plugin#_TOC_OUTPUT-->
<!--#toc_plugin#_START_TOC_INDEXING-->
<h2>Here is a heading</h2>
<p>Here is some text</p>
<h2>Here is another heading</h2>
<h3>Here is a subheading</h3>
<h3>Here is another subheading</h3>
<!--#toc_plugin#_END_TOC_INDEXING-->
### EXPECTED OUTPUT: ###
<div id="toc">
<h2>Page Contents</h2>
<ul>
<li><a href="#Here is a heading_1">Here is a heading</a></li>
<li><a href="#Here_is_another_heading_2">Here is another heading</a>
<ul>
<li><a href="#Here_is_a_subheading_3">Here is a subheading</a></li>
<li><a href="#Here_is_another_subheading_4">Here is another subheading</a></li>
</li>
</ul>
</div>
<h2><a name="Here is a heading_1" id="Here is a heading_1"></a>Here is a heading</h2>
<p>Here is some text</p>
<h2><a name="Here_is_another_heading_2" id="Here_is_another_heading_2"></a>Here is another heading</h2>
<h3><a name="Here_is_a_subheading_3" id="Here_is_a_subheading_3"></a>Here is a subheading</h3>
<h3><a name="" id="Here_is_another_subheading_4" id="Here_is_another_subheading_4"></a>Here is another subheading</h3>
UpdatesCorrections to usage documentation.

Please login to comment.