Template talk:Collapse top

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Why doesn't this template work as expected in the mobile rendering?[edit]

I browsed to a page using this template on my phone and the content which was intended by page authors to be collapsed by default was instead showing and not collapsible. Can this be fixed? IMO mobile readers should be given as close to the same reading experience as practical.

Also, if this is going to remain broken for mobile views, the template documentation should describe what happens there and why. Otherwise desktop authors who don't themselves use mobile devices are given no hint that use of this template is buggy/broken for mobile readers. –jacobolus (t) 19:04, 10 February 2023 (UTC)[reply]

The documentation is not protected. There are notes about collapsing at Help:Collapsing and MOS:DONTHIDE. – Jonesey95 (talk) 19:23, 10 February 2023 (UTC)[reply]
Updated the documentation (also for {{Collapse}}) with a "Limitations" section, transcluding the relevant material from Help:Collapsing#Limitations, so if that gets updated with new information like an MW upgrade resolving the issue, then the templates' /doc pages will automatically inherit the update.  — SMcCandlish ¢ 😼  20:38, 14 December 2023 (UTC)[reply]

Protected edit request on 26 May 2023[edit]

It would be useful if it were possible to left align the textbox by introducing a |margin= parameter, i.e.:

  • Replace: margin: 0.2em auto auto;
  • With: margin: {{{margin|0.2em auto auto}}};

T.Shafee(Evo&Evo)talk 05:43, 26 May 2023 (UTC)[reply]

 Not done: I don't see a strong rationale to support a custom option here. Izno (talk) 00:48, 17 June 2023 (UTC)[reply]
Also redundant with |indent= which has simple syntax for left alignment control, which was the stated use case. A |margin= could do more than that, but there's not any demonstrated need for it, and people would probably be apt to do silly things with it.  — SMcCandlish ¢ 😼  20:34, 14 December 2023 (UTC)[reply]

Hide the title when the content is uncollapsed[edit]

Is there a way to have the line of text that is visible when the box is collapsed disappear when the box is uncollapsed. Clearly "something sort-of like this" can be done, given the [show] link disappears (replaced by [hide]). Two ideas that have been mentioned in the banner-shell redesign RFC suggest this would be a useful feature. DMacks (talk) 20:53, 18 July 2023 (UTC)[reply]

The [hide]/[show] stuff is done by a site-wide Javascript feature that makes use of CSS classes like mw-collapsible, mw-collapsed, etc.; I think it may be built into MediaWiki. It's not "magic" done within the template code. There's not a facility I can think of in the basic MW templating language that would make what you want feasible, though I would think it could be done in Lua code by converting from a template to a module and then working something up in the module.  — SMcCandlish ¢ 😼  20:13, 14 December 2023 (UTC)[reply]

Want parameter to make the box as wide as the title, and left aligned[edit]

Please see: Wikipedia talk:Manual of Style/Accessibility#Template:Collapse top, and Template:Collapse bottom.

I would like a parameter that makes the collapsed box as wide as the title and left aligned.

There is already a parameter to left align the title text. I am not talking about that. I want the box itself aligned to the left side of the page.

And I want the title text to wrap in narrower screens. --Timeshifter (talk) 16:54, 10 February 2024 (UTC)[reply]

Where do the "hide" and "show" come from?[edit]

@Izno: someone who might have a clue. That is to say -- the texts "hide" and "show" in this template, they don't actually show up in the source text -- are they from common.js or something? jp×g🗯️ 00:10, 19 May 2024 (UTC)[reply]

I see that there's a MediaWiki:Collapsible-expand and a MediaWiki:Collapsible-collapse but I don't see how they're actually being invoked in this template. Through the JavaScript or what? jp×g🗯️ 00:12, 19 May 2024 (UTC)[reply]
mw:Manual:Collapsible elements. Izno (talk) 00:45, 19 May 2024 (UTC)[reply]