B2Evolution: Table of Contents plugin

Here is a plugin for B2Evolution 1.6, that creates a renders the special tag: <!--toc--> as a table of contents.

This way you can create a menu post that displays posts from a certain category. This is handy, if you use b2evolution as a content system for a traditional web site, not just as a blog.

Here is a sample use. For the top 5 posts in the B2evolution category, and the first 10 words from each post, showing dates; use: <!--toc dates="true" num="5" cut="10" category="29"-->

Sample removed when blog moved to wordpress

The blog’s or the skin’s css file can be used to customize the display of the table of contents.

Download the file and save it in your b2evolution plugins directory.

Update 1/30/2006: Download link fixed
Update 3/20/2006: The num option was being ignored, it is working now.
Update 7/17/2006: This plugin will work in B2Evolution 1.6 or 1.8.
Update 7/26/2006: Fixed some PHP warnings in the 1.8 code.

12 thoughts on “B2Evolution: Table of Contents plugin”

  1. Download link seems to have a permission issue –

    You don’t have permission to access /media/_toc.plugin.php on this server.

  2. I m using this plugin, but although I change value to num, example

    It always showing latest 4 post,changing value to num has no effect.

  3. 1) You have to save the _toc.plugin.php in your b2evolution/blogs/plugins folder.
    2) You have to go to the Admin area of b2evolution, “Settings” page, “Plug-ins” tab.
    3) Select the “Install” link next to the TOC plugin entry.
    4) Add the special code to a post, AND check the little TOC checkbox in the “Text Renderers” section.

  4. See the first sentence of this post: Here is a plugin for B2Evolution 1.6.

    For B2E 0.9 it will take some programming to make it work.

  5. FIRST! Sorry for the double post, this is the comment you should read, it will make more sense. :)

    I’m sorry for being dumb, but I can’t seem to get this plugin to work. I’ve downloaded the php file and uploaded it to the b2evolution plugins folder.

    Where do I put the “toc” tag? If I put it in a post, it displays nothing, I’ll assume this is because the browser is treating the tag as an HTML comment. If I put the tag inside a “php” tag in my main.php file, it comes up with a parse error. If I put the tag in a “div” tag in main.php file, it treats it like an HTML comment.

    Where does this tag go in order to display the table of contents?

    I’m looking to generate (automatically) a table of contents that resembles this page: http://www.iwillteachyoutoberich.com/toc.html . Is this possible with this particular plugin?

    Thanks for any help you can supply. If you want to contact me directly, feel free to email me: v.fetis@ei4c.com .

  6. I have added the “blog” param in the special tag and $myopts[“blog”] in php file.

    This is very useful for me.

    <!–toc dates=”true” num=”5″ cut=”10″ blog=”3″ category=”29″–>

  7. Jeremy, this is a nice piece of work. I am having trouble in working out how to use it as a genuine Table of Content though. I tried to set it up on Blog 4 and have it list Content by Category for Blog 2 (Main Blog) but couldn’t get that to work.
    Having it appear in a normal post in the main blog just doesn’t seem like a true TOC.
    It would be great if it worked like arcdir.php and could just be linked to.

    Huge potential and thanks for the work.

  8. Hi,

    I installed your toc plugin and set it as “always” so I wouldn’t have to bother ticking “toc” every time I blogged. I then edited a number of entries to incorporate the line you mentioned but I get no table of contents as yet.

    Have I missed anything???

    Any help would be much appreciated!

    Thank you in advance and keep up the good work.

    Ingo Wagener

  9. Do you have an update for B2Evolution v2.4? I got this error when running the plugin on V2.4: Fatal error: Class ‘ItemList’ not found in /hsphere/local/home/learnss/plugins/_toc.plugin.php(205) : runtime-created function on line 18


Comments are closed.