Difference between revisions of "Template:ToC limit"

From Flexible Survival
Jump to: navigation, search
(Adding a template to shrink very long tables of content)
 
(Template is apparently impossible without updating CSS. Notes written for admins.)
 
Line 1: Line 1:
<div class="toclimit-{{{1|{{{limit|3}}}}}}">__TOC__</div>
+
<includeonly><div class="toclimit-{{{1|{{{limit|3}}}}}}">__TOC__</div></includeonly>
 +
 
 +
<noinclude>Apparently this wont work without an update to the media.css adding the following (according to [[http://en.wikipedia.org/wiki/Template_talk:TOC_limit|this link]]:<pre>
 +
 
 +
/* Allow limiting of which header levels are shown in a TOC;
 +
  <div class="toclimit-3">, for instance, will limit to
 +
  showing ==headings== and ===headings=== but no further
 +
  (as long as there are no =headings= on the page, which
 +
  there shouldn't be according to the MoS).
 +
*/
 +
.toclimit-2 .toclevel-1 ul,
 +
.toclimit-3 .toclevel-2 ul,
 +
.toclimit-4 .toclevel-3 ul,
 +
.toclimit-5 .toclevel-4 ul,
 +
.toclimit-6 .toclevel-5 ul,
 +
.toclimit-7 .toclevel-6 ul {
 +
    display: none;
 +
}
 +
</pre>
 +
This might not be all that's needed. A way of showing/hiding the TOC would be great as well. The biggest need for this feature is [[NPCs (Single Player)|this page]] because the list is massive and thus, largely useless. Limiting the list to only top level headings would allow it to be sorted by district instead, which would be far more useful. I have added <nowiki>__NOTOC__</nowiki> to the page as a temporary fix. If it's impossible to add this content (or I am not understanding how to do it properly), admins please delete this page.
 +
</noinclude>

Latest revision as of 14:52, 12 January 2015


Apparently this wont work without an update to the media.css adding the following (according to [link]:

/* Allow limiting of which header levels are shown in a TOC;
   <div class="toclimit-3">, for instance, will limit to
   showing ==headings== and ===headings=== but no further
   (as long as there are no =headings= on the page, which
   there shouldn't be according to the MoS).
 */
.toclimit-2 .toclevel-1 ul,
.toclimit-3 .toclevel-2 ul,
.toclimit-4 .toclevel-3 ul,
.toclimit-5 .toclevel-4 ul,
.toclimit-6 .toclevel-5 ul,
.toclimit-7 .toclevel-6 ul {
    display: none;
}

This might not be all that's needed. A way of showing/hiding the TOC would be great as well. The biggest need for this feature is this page because the list is massive and thus, largely useless. Limiting the list to only top level headings would allow it to be sorted by district instead, which would be far more useful. I have added __NOTOC__ to the page as a temporary fix. If it's impossible to add this content (or I am not understanding how to do it properly), admins please delete this page.