Request for TOC to display only main headers in Home page

Support Ticket

+status
 

When enforcing the Table of Contents Feature in our new Internal WAGN, the TOC shows not only the main headings (Heading 1 style) but also the sub headings (Headings 1 & 2 style from inside each inline card).

1. How can we enable TOC to show only the Heading 1 & 2 styled headings on the home page instead of the headings in the embedded cards?
2. Also how can we display the TOC bullet points as numbers instead of Roman Numerals?

The data was copied across from the Old WAGN v1.4.0 stored in an old server to the new WAGN v1.5.2 in the new server. In the old WAGN, the TOC was being displayed correctly showing only the main headings as can be seen in the example below  

 

We refactored inclusions recently, and got this new behavior as a result. In some cases it's a good thing, but obviously not always. We plan to restore and perhaps even improve on how tables of contents work when we refactor table of contents.

 

Meanwhile, one possible solution is to make all of the headers in the included cards h2 (fortunately, it looks like you only have one h2 there already, which you could just make bold or something). Then you could use this CSS to make h2 tags not show up on the including card:

.SELF-home ol ol { display: none; }

(I'm assuming the including card is "Home". If not, replace "home" with whatever the key is of the including card.)

 

For your second question, there's no way that I know of to use numbers instead of Roman Numerals. I'll put a note about that on the refactoring ticket.

 

--John Abbe, 2011-03-22


#2 is actually easy - this is done with CSS. The relevant bit in the current css is here:

 

.table-of-contents ol {
list-style-type: upper-roman;
}
.table-of-contents ol ol {
list-style-type: upper-alpha;
}

 

But you can easily override that in your *css card.

 

As for #1, everything John said is correct. The table of contents processing now happens after the inclusion processing, so it's not possible to discriminate among inclusions.

 

His solution is a viable one. You could also add h3's into the mix and style them to look like h2s by tweaking this line in your *tinyMCE card:

 

theme_advanced_blockformats : "p,h1,h2,pre",

 

The ToC will only process h1 and h2s.

 

As John mentioned, we're hoping to refactor all of this soon and give more nuanced control.

  --Ethan McCutchen.....Thu Mar 24 10:07:43 -0700 2011