create new tag
, view all tags

Feature Proposal: TOC variable to ignore null headers


The current result of a %TOC% is quite simply ugly if there are "jumps" in the header levels used in the topic.

Why would anyone ever want to have "jumps" in the header levels used in a topic? Because sometimes it simply looks better to skip to a lower header level than the immediate preceeding -1.

Try to do the same exercise in Word or OpenOffice. Unlike TWiki they will not print a table of contents and put in "implicit" headers that do not exist in the document. It is not logical that TWiki adds something (even if empty) on its own to the TOC.

Description and Documentation

Suggest a new option on %TOC% variable: ignoreimplicitnullheaders

The result of this will be that TWiki will not include 'implicit' headers in the table of contents

Example: Topic use headers of level 1, 2 and 5.

  • ignoreimplicitnullheaders is present in the TOC statement: The table of contents will not include empty lines for implicit level 3 and 4 headers.
  • ignoreimplicitnullheaders is not present in the TOC statement: Default. The table of contents will look as today.


For the purpose of the example below is a header at level 5:

example header

This results in the following TOC for this topic page:

It is those lines with empty arrows we would like to get rid of. Indention is ok. Simply remove the lines with no text.


WhatDoesItAffect: Rendering


Freetown already adds new functionality to %TOC% rendering. Maybe not to late to add this. smile
See AddControlOverTocRendering.

-- Contributors: LarsBruunxHansen - 24 Aug 2007


I agree and would even suggest that the ignoreimplicitnullheaders option be treated as the default behaviour.

-- KeithHelfrich - 24 Aug 2007

Note that in FF you see one line with 3 arrows. In IE you get the empty lines also.

I am against adding this ignoreimplicitnullheaders feature.

We might as well call is turnoffstupidbug

This is simply a bug that should be fixed and should be raised as a bug item with "normal" priority. I am sure noone finds the current behavior desired.

-- KennethLavrsen - 25 Aug 2007

I don't think this is really a bug with TOC, more of a rendering issue for list items that comes down to the chosen implementation in HTML (ul, li).

  • Level 1
      • Level 3
  • Level 1

The arrows is from the twikiToc CSS class.

-- SteffenPoulsen - 25 Aug 2007

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-08-25 - SteffenPoulsen
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.