Tags:
create new tag
view all tags

Question

The default TOC hhas funny down-arrows. They don't "do" anything and changing the bullet character has no effect on these. What's the best way to change these?

A co-worker also asks "I'd like to change the way the TOC displays. I'd like to change the colors, make the h1s bold and put a line break in front of the h1s or something. Is CSS the answer?"

Can anything be done?

(p.s. I've been using TREEBROWSER to affect the TOC. Other suggestions appreciated).

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- VickiBrown - 20 Sep 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Yes, use CSS. TWiki writes out 2 CSS classes to be able to style the TOC: twikiToc and twikiTocTitle. Pattern skin uses these styles to create the indent and images:

.twikiToc {
   margin:1em 0;
   padding:.3em 0 .6em 0;
}
.twikiToc ul {
   list-style:none;
   padding:0 0 0 .5em;
   margin:0;
}
.twikiToc li {
   margin-left:1em;
   padding-left:1em;
   background-repeat:no-repeat;
   background-position:0 .5em;
}
.twikiToc li {
   background-image:url(bullet-toc.gif);
   background-repeat:no-repeat;
   background-position:0 .4em;
}
.twikiToc .twikiTocTitle {
   margin:0;
   padding:0;
   font-weight:bold;
}
.twikiToc .twikiTocTitle {
   color:#777;
}

This is a typical styled TOC:

If you want to get a 'normal' styling, 'overwrite' pattern skin's style with:

<style>
.twikiToc ul {
list-style-type:disc;
}
.twikiToc li {
background-image:none;
padding-left:0;
}
.twikiToc .twikiTocTitle {
   color:#000;
}
</style>

This then results in:

By the way, we call the TOC links "in-page links" - they point to a position on the same page. So it is not just a list, but also a menu.

-- ArthurClemens - 20 Sep 2007

Change status to:
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2007-09-20 - ArthurClemens
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.