about

With the TOC plugin you can build a "table of content" link list.
The Plugin grabs all headlines from the content and add a anchor to them.

Note: TOC used a simple RegularExpression for getting all headline. It doesn't match on headlines if the tag has any attribute (e.g. class="foo"). So you can easy "exclude" headlines by adding a attribute ;)

usage

The Table of contents plugin can be inserted into PageContent or into global template.

TOC is displayed only if there exists at least the specified number of headlines. (lucidTag parameter 'min')

You should add something like this, at the top of your global template:

1
<a name="top"></a>

example

1
{% lucidTag TOC %}

specified number of headings with the min parameter:

1
{% lucidTag TOC min=4 %}

change the look

The TOC plugin used two templates:

  • TOC/TOC.html
  • pylucid/headline_anchor.html

You can overwrite these template, use: PyLucid admin menu / tools / overwrite templates

TODO

The RSS Feed plugin can generate many headlines, from the feed. There headlines would be inserted into the TOC, too :(
Work-a-round: Overwrite the RSS Tremplate and add a class to all headlines.