Template talk:Collapse-mobile

From Meta, a Wikimedia project coordination wiki

Recognising that this is a collapsed box[edit]

How does the reader know to click on the header to expand the box? · · · Peter (Southwood) (talk): 14:22, 24 May 2017 (UTC)[reply]

Hm, I had not thought of that, Pbsouthwood. Does this edit I just made seem like it resolves the issue? Kbrown (WMF) (talk) 14:25, 24 May 2017 (UTC)[reply]
Certainly, though it might be done more elegantly perhaps. I am considering using it for the Wikimania 2018 website, so would like it to be idiot-resistant and elegant. Since you responded so promptly I will take advantage and request a couple of refinements which may be easy, maybe not. The first would be to shift the expand link to the far right, and call it "show", as that seems to be the standard for collapsible boxes, as long as that would not mess with mobile function. The second is if possible to put a "hide" button at the bottom right corner of the box, so it isn't necessary to go back to the top to collapse it again. Cheers, · · · Peter (Southwood) (talk): 15:18, 24 May 2017 (UTC)[reply]
I'll see what I can do about those suggestions, Peter! Will likely not be able to complete them today (or maybe even this week), though, as I'm juggling some other, pressing work this week. But please do feel free to leave any other ideas here and I will do what I can to integrate them when possible! Kbrown (WMF) (talk) 15:27, 24 May 2017 (UTC)[reply]
@Kbrown (WMF):, That would be quite satisfactory. There is no great rush. Much appreciated, and will follow your suggestion. The template works well enough for development as it is. Cheers, · · · Peter (Southwood) (talk): 08:22, 25 May 2017 (UTC)[reply]
A smaller gap between two collapsed boxes.
Hi again Pbsouthwood! I did some poking around on your requests and I was able to move the "expand" text to the far right (I also made that text customizable - the default will be "(click to expand)", but you can change it to any other text you want using the |toggletext= parameter). However, I wasn't able to add a "close" link at the bottom - this template, in order to work on mobile (in contrast to most collapse templates), uses a type of div class for the headline and content blocks that is not, as far as I was able to figure out, compatible with the types that allow you to customize or add additional, connected toggle links. Even the "click to expand" text you see in this template is not actually the trigger for expansion, as it would be in a standard collapse template; rather, clicking anywhere in the colored (top) box itself is what triggers the expand/collapse, and the toggle text is just there as a visual cue for what to do.

The caveat to all this is that my knowledge of templates is largely based on figuring things out as I go, rather than any native understanding of Mediawiki or template syntax, so it's entirely possible that there is a way to add a "collapse" link and I just couldn't figure out what it is or find the right documentation that held the answer. So if you (or anyone else reading this) comes across a way that might work, feel free to let me know and I can take another swing at it! Kbrown (WMF) (talk) 15:50, 26 May 2017 (UTC)[reply]

Dear Kbrown (WMF), have a look in French Wikipedia collapsible, where right and down arrows are used to indicate expandable and collapsible. Also, have a look in Greek collapsibles, here and here, to figure out how hover highlighting powers button-like collapsibles, compared to non-hover-highlighting.   ManosHacker talk 20:57, 4 April 2018 (UTC)[reply]