-
Modifying TOC
I don't like how a page's table of contents is contained in an entirely separate block from the main body of content; I'd like to float it to the side of the content or put it in the sidebar. However, the TOC itself is wrapped in block that don't allow me to target the TOC itself very easily in the CSS. I also couldn't figure out which template to modify to remove the surrounding block. How can I work with a more flexible TOC?
EDIT: A better question is probably where can I edit the {$contents|raw} found in vw_general_view?
https://i.imgur.com/fnm6eF2.png
-
vw_general_view, for the most part, is a wrapper for the vw_node_shell template, which is the main layout template for wiki pages.
TOC isn't contained in its own layout block by any force other than it automatically wanting to appear before the first heading. If you have other content before the first heading, or if you don't use H=1 as your primary heading (H=1 has equal weight to the page title), this usually looks fine. In this case, you can target it in CSS using nav.vw-toc-block
For cases where you must use H=1 and you cannot have other content before the first heading, or if you just wish the style TOC at will:
[TOC]NO[/TOC] // hides the default TOC
[TOC][/TOC] // manually shows the TOC here
[TOC]NO|[/TOC] // combined the two
You can wrap it in BB-Codes like:
[div] style="float: right" | [TOC][/TOC][/div]
or throw it in your sidebar like:
[div] position="sidebar" | [TOC][/TOC][/div]
If you're just floating it, note that you may still be constrained to whatever block you're currently in, for phishing protection (H=1 always creates a new block). Floats may be further constrained to the current heading you're under, but you can change this in your Aesthetics settings: "Constrain floated and absolute content within sections?" If this is disabled, floats should ignore H=2+ boundaries.
-
Fantastic, thanks!
Related to the theme I noticed that the topbar, in the wiki only, is pushed down one pixel and has a gap where you can see the content on the other side. I haven't been able to figure out what's causing it. Any ideas?
https://i.postimg.cc/GhHzfYFb/image.png
EDIT: Seems I solved this while playing with other styles!