Template:Compact TOC is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
This is the talk page for discussing improvements to the Compact TOC template. |
|
Archives: 1Auto-archiving period: 30 days |
Using the Download as PDF or Printable version tools on an article displays normal TOCs in the output, but it hides the Compact TOC. It would be useful if there were an option to make this printable again. RandomBlobby (talk) 00:51, 4 June 2022 (UTC)
Custom class support
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please apply this sandbox edit to {{Compact TOC}} to add support for specifying a custom CSS class for the outer container using |class=
. This lets, say, a wrapper template add TemplateStyles that tweaks the custom TOC styling. And on Wikisource (which imports this template) some "magic" CSS classes affect software functionality, so having the ability to set the right magic CSS class to tag parts of the table of contents is critical.
Test case here. Xover (talk) 10:06, 4 December 2022 (UTC)
- To editor Xover: exactly what are we looking for? I see no difference on the testcases page between the sandbox and the live template. Is there supposed to be a visible difference? P.I. Ellsworth , ed. put'r there 13:55, 5 December 2022 (UTC)
- @Paine Ellsworth: No visual difference. The patch adds a
|class=
parameter that lets you add a CSS class to the template's output, and which in turn can be targetted by TemplateStyles (in a wrapper template) or a user script or Gadget. You can see the change in your web browser's web inspector:<div class="noprint ws-summary">…</div>
(thews-summary
class was passed as a parameter). Xover (talk) 14:12, 5 December 2022 (UTC)- I use the Chrome browser and I've checked the developer tools, everywhere, and I don't see a "web inspector" anywhere. Help me out. I obviously need a little larnin'. P.I. Ellsworth , ed. put'r there 14:32, 5 December 2022 (UTC)
- To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools. You can also use ⌘ Cmd+⌥ Opt+J (on macOS), or Ctrl+⇧ Shift+J (on Windows/Linux). You should also have a "Inspect" menu item in the context menu (right-click menu) for an element in a web page, which is probably the most convenient way to see it. Xover (talk) 14:44, 5 December 2022 (UTC)
- Completed – man that was hard to find, but I did find it. Thank you for your patience! P.I. Ellsworth , ed. put'r there 15:48, 5 December 2022 (UTC)
- Thank you! Xover (talk) 16:27, 5 December 2022 (UTC)
- my pleasure! Paine 16:36, 5 December 2022 (UTC)
- Thank you! Xover (talk) 16:27, 5 December 2022 (UTC)
- Completed – man that was hard to find, but I did find it. Thank you for your patience! P.I. Ellsworth , ed. put'r there 15:48, 5 December 2022 (UTC)
- To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools. You can also use ⌘ Cmd+⌥ Opt+J (on macOS), or Ctrl+⇧ Shift+J (on Windows/Linux). You should also have a "Inspect" menu item in the context menu (right-click menu) for an element in a web page, which is probably the most convenient way to see it. Xover (talk) 14:44, 5 December 2022 (UTC)
- I use the Chrome browser and I've checked the developer tools, everywhere, and I don't see a "web inspector" anywhere. Help me out. I obviously need a little larnin'. P.I. Ellsworth , ed. put'r there 14:32, 5 December 2022 (UTC)
- @Paine Ellsworth: No visual difference. The patch adds a
No padding around content in Vector 2022
editThe TOC on Vector doesn't look too good. Could padding be added around the content of the TOC when using Vector 2022? Dreamy Jazz talk to me | my contributions 10:33, 13 March 2023 (UTC)
- See next section. Mathglot (talk) 06:34, 21 April 2023 (UTC)
- This is fundamentally phab:T314254, also tracked at MediaWiki talk:Common.css/to do#toccolours. You get a gist at the latter that I don't exactly know the best way to proceed with the toc-like templates (since that's not the stated focus there), but in Vector 22 I'm kind of inclined to display: none these (as commented below now) since they're less useful than the TOC on the left.
- Sometimes though, templates like this one don't point to the same page but to different pages, as is common for very large lists that need to be split alphabetically. And yes, that does appear to be supported by this template given what's in the wikitext. Display none for those cases without a navbox or sidebar in place to carry that navigation is probably a net loss. I'd be hard pressed to figure out the best way to find and deal with the intersection of pages using these TOC-like templates but without navboxes. Izno (talk) 05:32, 22 July 2023 (UTC)
- Good point about the large pages that had to be split, such that some or all of the letter index might be off-page links; hadn't thought of that. Thanks for raising that issue. Mathglot (talk) 06:13, 22 July 2023 (UTC)
- While there is no movement in the task, should at least the heading "Contents" be centrally aligned relative to the alphabet? Or idk, maybe switch to «Content: A · B · C ...» view for Vector 2022, because this central position of the heading pretty much loses its meaning when there is no
toccolours
styles. Jack who built the house (talk) 05:12, 29 December 2023 (UTC)
Configurability options for table of contents and Vector 2022 issues
editThe issue of configurability options for table of contents is being tracked in Phabricator. Mathglot (talk) 06:34, 21 April 2023 (UTC)
- Izno has come up with a solution at another template using TemplateStyles that may apply here, as well; please see Template talk:Skip to bottom#Unnecessary link of "Skip to TOC". Mathglot (talk) 18:48, 20 July 2023 (UTC)
Merge
editTfD voted to merge this template with {{auto compact TOC}}.[1] I've done a demo of the merge and template styles similar to vector/monobook in the sandbox. Ping for Erutuon who created the auto template. To avoid moving this template to lua, the change would just bypass most of this template when |omit=auto
is present. Feedback is welcome, Rjjiii (talk) 05:55, 29 September 2024 (UTC)