Template talk:Collapsible list
This is the talk page for discussing improvements to the Collapsible list template. |
|
Archives: 1, 2 |
|
||
Hide title of list when list is uncollapsed?
On WikiProject Video games, we use collapsible lists in infoboxes where many release dates are listed and use the initial date as title of the list. However, when the list is expanded the initial date is shown once as the title and once in the platform-specific section within the list, making the first one redundant.
Given this, is it possible to hide the title when the list is uncollapsed or could that feature be implemented? Lordtobi (✉) 07:24, 6 June 2018 (UTC)
- @Lordtobi: link please.. —TheDJ (talk • contribs) 10:55, 6 June 2018 (UTC)
- Grand Theft Auto V, for example. Lordtobi (✉) 11:29, 6 June 2018 (UTC)
- @TheDJ: Hi, any update on this? Lordtobi (✉) 13:42, 8 October 2018 (UTC)
- Grand Theft Auto V, for example. Lordtobi (✉) 11:29, 6 June 2018 (UTC)
- This doesn't seem like behavior we should support in the core module. This usage is niche, at best. --Izno (talk) 20:20, 23 February 2021 (UTC)
Should not hide by default
Per MOS:DONTHIDE this should not be in a collapsed state by default. Other collapsible content templates have been fixed (unless I'm missing one somewhere) to resolve this failure to comply with the guidelines. Auto-collapsing content is both an accessibility problem (screenreader users cannot expand it) and a mobile problem (various mobile devices/browsers will not show such elements or allow them to be expanded again). There are two approaches to fixing this (then updating the /doc to compensate):
- Invert the default behavior.
- Install a namespace switch to invert the default behavior in mainspace, but leave it auto-collapsing otherwise.
Option 2 might theoretically be preferable if a) this template is frequently used outside of mainspace, and b) only for content where accessibility and mobile use are not an issue. I'm very skeptical this will actually be applicable, so absent a strong showing that is it, option should be implemented. — SMcCandlish ☏ ¢ 😼 12:03, 29 July 2018 (UTC)
Template-protected edit request on 2 March 2020
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Not sure what needs to be changed in an X to Y fashion since I have no knowledge editing templates this complex, but here's the issue: When I implemented {{Collapsible list}} on Tesla, Inc. as can be seen on this diff the title overflowed under the "show" link, so I had to insert <br/>
in the title of the collapsible list in this diff. (In this edit I also made it an hlist but that's unrelated to my request.) This is not the most ideal compromise as some readers view Wikipedia in different fonts, sizes and with certain accessibility modes active that may make this compromise ineffective. Please may you assist me in rectifying this by in some way making the area behind the "show" button unable to have title text be printed behind it. comrade waddie96 (talk) 17:15, 2 March 2020 (UTC)
- TheDJ tried to fix this problem (list name overlaps the show/hide link) a while ago (see section above), but it didn't work. Someone else might have a brilliant idea to fix this long-standing problem. – Jonesey95 (talk) 18:18, 2 March 2020 (UTC)
- I switched to mw-collapsible in the sandbox. The testcases look right for me. @TheDJ: What was the problem last time? (Please note that the sandbox already contains a change in connection with Template talk:Collapsible list/Archive 1#titlestyle again, and I followed its example for framestyle as well. If that’s too risky, we can get back to the old version only overriding styles when there’s no framestyle parameter.) —Tacsipacsi (talk) 01:36, 3 March 2020 (UTC)
- Jonesey95,Idon't remember exactly, but I suspect it was align:center'ed content being pushed off center by the width of the toggle. —TheDJ (talk • contribs) 10:37, 5 March 2020 (UTC)
- We have to give up one of them: either the text is precisely centered, and consequently it overlaps with the collapse toggle, or it doesn’t overlap, but consequently goes to the left that much. I support readability over precise alignment. —Tacsipacsi (talk) 22:41, 10 March 2020 (UTC)
- Not relevant to any change to this template, however just pointing out MOS:DONTHIDE is against hiding content in an infobox (or anywhere). --Gonnym (talk) 11:01, 9 March 2020 (UTC)
- I second this. Whatever is to be hidden, it is contrary to the intention of the WP:INFOBOX. iow: irrelevant. -DePiep (talk) 20:59, 13 March 2020 (UTC)
- Not done for now: I'm getting a "not entirely sure what should be changed" vibe. Please feel free to set back to unanswered if/when you're sure of what to change and have a consensus to change it. Izno (talk) 20:56, 14 March 2020 (UTC)
- I think it’s pretty obvious what should be changed (this), the only real question is whether it should be changed at all. I say yes, but I think we should have a clear opinion (at least an “I don’t mind”) from TheDJ as well. —Tacsipacsi (talk) 00:38, 15 March 2020 (UTC)
It's a bit of a hack, but may like this ? —TheDJ (talk • contribs) 13:42, 15 March 2020 (UTC)
- @TheDJ: Yeah, most probably something hackish is needed. Your solution, however, is problematic in narrow cases—if the whole collapsible box is, say, 15em wide, more than the half of the whole width is the margin. I suggest rather using a same-sized floating box on the left size (and precisely setting the width of the right-hand collapse button using TemplateStyles). This way the 4+4em “margin” only applies to the first line; if the title doesn’t fit in one line, further lines are 100% wide (or whatever has been set in the style parameters). We should also pay attention to set these only when JavaScript is available (
html.client-js
), as the toggle button isn’t present otherwise. —Tacsipacsi (talk) 00:02, 16 March 2020 (UTC)
Oh hey, here I am trying to remove navframe and I stumbled on this discussion :^). Did we ever sort out what we were going to do or have a reasonable belief that the change is a good/neutral change? --Izno (talk) 19:25, 30 June 2020 (UTC)
- @Izno: I don’t think anything happened since my March 16 comment. I still think that this hack would work, but haven’t tried it. (As far as I remember, {{navbox}} uses something like this if either the navbar or the collapse button is hidden, by the way.) —Tacsipacsi (talk) 14:21, 1 July 2020 (UTC)
- Here I am again, this time to look at the actual problem. Initial glance appears to me that it will more or less work, though I agree it's kind of hacky. Good enough for me I think.
- Yes, navb(ar|ox) does similar. --Izno (talk) 06:49, 19 February 2021 (UTC)
- This replacement is live now. Please let me know if there are issues. --Izno (talk) 20:08, 23 February 2021 (UTC)
@Izno: I'm pretty sure this change messed up collapsible lists inside of collapsible lists- see Wikipedia:WikiProject_Video_games/New_article_announcements/Archivesbox; the outer template has its "show" button with float:right, but the inner ones now get float:none, making them confusingly show up on the line above the rest of the title. The template use here is minor, but if nested collapsible lists is a supported concept it's a valid bug. Only now noticing this since I interact with that template once a month. --PresN 15:11, 8 March 2021 (UTC)
- @PresN: Yes, that's caused by this change. I do not know why the Javascript is opinionated about what happens inside a list item. I honestly don't know if nested collapsible lists are or should be supported. We can probably make some local TemplateStyles to fix it if we want. --Izno (talk) 17:41, 8 March 2021 (UTC)
- Did some reading, found that it's been that way since 2010 and in fact deliberately inconsistently with how divs work:
/* list-items go as wide as their parent element, don't float them inside list items */
. --Izno (talk) 20:09, 8 March 2021 (UTC)- Filed a phab task for it, I don't know if anyone will action it. phab:T276861. --Izno (talk) 20:45, 8 March 2021 (UTC)
- Thanks, Izno! Fingers crossed for a solution.
PresN, I think we could work something up with a navbox and collapsible lists if worst came to worst. It might be ugly, but probably better than what we have now... -Thibbs (talk) 23:11, 9 March 2021 (UTC)- Well, the solution is basically known and I've implemented a solution local to that template. Still not sure whether to implement here. --Izno (talk) 23:52, 9 March 2021 (UTC)
- Thanks Izno; yeah, that template is an ugly maintenance template in a little-seen set of project pages, and could be replaced pretty easily with a non-collapsible box of links if anyone really wanted to. The issue is more if there's a valid use case for nested collapsible lists in article space that this bug is breaking, which I'm not sure there really should be since collapsible templates in the first place get the side-eye for accessibility/mobile reasons. --PresN 23:07, 10 March 2021 (UTC)
- Well, the solution is basically known and I've implemented a solution local to that template. Still not sure whether to implement here. --Izno (talk) 23:52, 9 March 2021 (UTC)
- Thanks, Izno! Fingers crossed for a solution.
- Filed a phab task for it, I don't know if anyone will action it. phab:T276861. --Izno (talk) 20:45, 8 March 2021 (UTC)
Liststyle centers text and does not make it smaller
Please see these test cases. When I try to add |liststyle=font-size:85%;
to a bulleted list, the text is not made small, and it is centered instead of placed at the left. I expect that the problem is either in my parameter value or in the logic applied when a custom liststyle is chosen. Who can tell me what is going on here? – Jonesey95 (talk) 17:24, 19 June 2020 (UTC)
- I've just sorted these both but I suspect it will have affected one or two pages in the wild. --Izno (talk) 20:18, 23 February 2021 (UTC)
Link to show the list overlaps title
In article Elizabeth II, template {{Collapsible list}} is used inside the infobox. Unfortunately, the link to show the collapsed list overlaps with the text "Queen of the United Kingdom and the other Commonwealth realms". I've added a new test case to demonstrate the issue. —andrybak (talk) 08:29, 6 September 2020 (UTC)
- Fixed? Sandbox looked good before I pushed the sandbox stuff live. --Izno (talk) 20:12, 23 February 2021 (UTC)
Styles not working?
{{Collapsible list|framestyle=background-color:#f8f9fa;|titlestyle=color:green;|title=Title|1=First item|2=Second item}}
- First item
- Second item
What am I missing here? – Uanfala (talk) 20:21, 1 April 2021 (UTC)
- Uanfala, fixed your code for you. Frietjes (talk) 22:39, 1 April 2021 (UTC)
- Ah, thanks, Frietjes. Silly it didn't occur to me that the quotation marks wouldn't be required. – Uanfala (talk) 22:43, 1 April 2021 (UTC)
Page update
Update the page as of new features in collapse by wikipedia in 2019.A.S. Universal (talk) 04:40, 31 July 2021 (UTC)