Author Topic: New Droplet: CreateToc  (Read 4454 times)

Offline BlackBird

  • Posts: 2573
New Droplet: CreateToc
« on: November 15, 2011, 05:23:41 PM »
The CreateToc-Droplet creates a "Table of Contents" from all headings (h1-h6) in a page. The Toc is placed where you place the droplet call. In addition, a "Back to Top"-Link is added before each heading.

Download:

http://www.websitebakers.com/pages/droplets/downloads.php (scroll to "Navigation")

Usage:

[[CreateToc]]

or

[[CreateToc?float=right]]

...to have the Toc floated right. If you wish to have your entries numbered (like an index), add

[[CreateToc?float=right&number=1]]

(The value you give for "number" doesn't matter. You can also set it to "true" or "ohmy" or ...)

ToDo:

* At the moment, there's no indentation; i.e., in the Toc there's no difference between h1 and h6


Best use:

If you have just one WYSIWYG-Section on a page, you may create your own Toc by adding Anchors. But if you have more than one WYS-Section (or sections of other types), CreateToc creates a nice Toc for you. :)

Try it and let me know how it works.
« Last Edit: November 16, 2011, 01:20:41 PM by BlackBird »

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: New Droplet: CreateToc
« Reply #1 on: November 15, 2011, 09:09:40 PM »
Good idea.

One just must be carefull by not using headings in the template itself (i.e. sidebars etc.).

Regards,
Stefek
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

mr-fan

  • Guest
Re: New Droplet: CreateToc
« Reply #2 on: November 16, 2011, 09:43:54 AM »
Good idea.

One just must be carefull by not using headings in the template itself (i.e. sidebars etc.).

Regards,
Stefek

For this you could use a special Format within the CKEEditor to use a Class with the H1 - H3 and search with the Droplet for this CSS class....no problem....but this must be arranged by an admin or will be a good tut....;)

great idea bianka! - i will use it

regards mr-fan

Offline warp

  • Posts: 4
Re: New Droplet: CreateToc
« Reply #3 on: October 02, 2013, 01:57:35 PM »
I would like to place the TOC of one page on a different subpage.
Would that be possible?

i.e all articles from http://kalfcomputertechniek.nl should be TOC'ed on
http://www.kalfcomputertechniek.nl/pages/artikellijst.php

I'm doing this now by hand & anchors but the labour in it is immens.

Thanks

Frank
« Last Edit: October 02, 2013, 02:00:13 PM by warp »