Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Similarly to this question, I'd like to tweak where the default ToC appears in my MediaWiki site. Currently it appears at the first header, but occasionally I have significant content in the first paragraphs, before any headers.

Is there any way to make the ToC top-aligned with the page, rather than with the first header?

share|improve this question
1  
According to a guideline of the English Wikipedia, the lead section should not be more than four paragraphs long. You might consider adopting similar guideline on your wiki. –  svick Mar 3 '13 at 20:41
    
Agreed. But even two short paragraphs, or one paragraph and a small table or other special content, can bury the ToC further than I'd like. –  Jon of All Trades Mar 4 '13 at 2:16
add comment

1 Answer 1

As written in one of the answers, ToC can be added anywhere to your page by using the following keyword:

__TOC__

If you want to add TOC to same place on every page, you can do so by styling it in your MediaWiki:Common.css wiki page (which gets added to CSS for all skins used, see an example of such page on Wikipedia). Something along the lines of this might work:

#toc { position: absolute; top: 2em; right: 0.5em; };
share|improve this answer
    
That's something, but it requires making an adjustment on each page. Is there a way to make the ToC appear at the top of the page by default? –  Jon of All Trades Mar 6 '13 at 3:04
    
You can set it to static positioning in global CSS. –  che Mar 7 '13 at 13:03
    
Great! How? Put it in an answer and I'll gladly accept it. –  Jon of All Trades Mar 7 '13 at 22:28
    
Added a rough attempt :-) –  che Mar 7 '13 at 22:37
    
So close! That does put the ToC in the top-right corner, but now it overlays content instead of flowing as it did when it was float: right;. If I was writing an ordinary web page, floating would be perfect, because I could change the insertion point. –  Jon of All Trades Mar 8 '13 at 13:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.