Template talk:Compact TOC

How to specify a sub-article for numbers?
We are using this template on the various parts of List of Nintendo Switch games with "num=yes". The number link works fine on the page containing the numbers, List of Nintendo Switch games (0–9 and A–C). However on other pages, such as List of Nintendo Switch games (D–G), it links to the 0–9 section of that page (e.g. D–G), which of course doesn't exist. How can I specify the sub-article for the numbers, the same way as I do for A, B, C etc (via "a=", "b=", "c="). Sorry if I'm being dumb, but I couldn't figure that out from the documentation. Kidburla (talk) 21:34, 27 October 2021 (UTC)
 * I've actually just figured this out, the parameter name is "0-9" (note it's a hyphen not a dash here). Probably the docs need to be updated to make that clear. Kidburla (talk) 23:44, 27 October 2021 (UTC)

Alignment of extra sections removed
This diff removed alignment of the optional sections below the ABCDEF listing. It makes irrelevant. Please revert. 71.247.146.98 (talk) 11:59, 2 November 2021 (UTC)

The above may be amended, since previous edits re:non-printing moved around text-align blocks. Don't have time to look at the source further right now. The fact remains that the align option does not work for custom sections. 71.247.146.98 (talk) 12:32, 2 November 2021 (UTC)

Print
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
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)
 * 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 &thinsp;, 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:  (the   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 &thinsp;, 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 (on macOS), or Ctrl (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)
 * ✅ – man that was hard to find, but I did find it. Thank you for your patience!  P.I. Ellsworth &thinsp;, 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)

No padding around content in Vector 2022
The 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 &#124; my contributions 10:33, 13 March 2023 (UTC)
 * See next section. Mathglot (talk) 06:34, 21 April 2023 (UTC)
 * This is fundamentally T314254, also tracked at MediaWiki talk:Common.css/to do. 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  styles. Jack who built the house (talk) 05:12, 29 December 2023 (UTC)

Configurability options for table of contents and Vector 2022 issues
The issue of configurability options for table of contents is being tracked in Phabricator. Mathglot (talk) 06:34, 21 April 2023 (UTC)
 * has come up with a solution at another template using TemplateStyles that may apply here, as well; please see Template talk:Skip to bottom. Mathglot (talk) 18:48, 20 July 2023 (UTC)