Template talk:Sidebar with collapsible lists

/ split
This template retains a great deal of (pretty pointless) flexibility from its parent, sidebar, and adds new features on top of that (so it's more of a supertemplate than a fork). One unnecessary complication is that the individual items can either take the format  (in which case they are presented as-is) or   (in which case they are collapsed). In a look through the ~500 uses of this template I've yet to find a single one which actually uses the  feature. As such, I'm going to aim to get rid of it with the aim of simplifying the output here and (hopefully) altering it so that the embedded lists are proper semantic HTML s rather than hand-hacked bunches of links. For now I'm adding tracking to the code to see whether any instances of this template really do use. Chris Cunningham (user:thumperward: not at work) - talk 09:32, 29 March 2011 (UTC)


 * Results are in: only eleven templates use the code, and all but two of them only use  (to provide a few unclassified links at the top of the template). I'm going to work on a solution which should allow for the removal of the general content code (a big code footprint win) without disrupting these templates, and will alter the remaining couple to cope without. Chris Cunningham (user:thumperward: not at work) - talk 10:03, 29 March 2011 (UTC)


 * Another piece to this puzzle in the dubious possible use of headingN vs. listNtitle. 50.53.15.51 (talk) 11:28, 4 April 2012 (UTC)

Improve appearance with horizontal guides?
This is an excellent template. I just learned about it, because Template:Style was converted to use it. One question: this template seems to lack horizontal guidelines. For example, shown below are two versions of the same Style sidebar: one with dividers and one without. The upper example (which does not use this Collapsible template) has the advantage that there are some horizontal lines to help the user visually track across and see which "Show" button to click (ignore the light blue background rectangles ... I dont think those are of value). In the lower example, some users may have a hard time visually figuring out which "Show" button to click. My question is: Is there a way to add the optional feature into SidebarWithCollapsible so that  horizontal grey lines could be drawn (without increasing the total size of the box)? --Noleander (talk) 14:20, 22 September 2011 (UTC)


 * Try adding "contentstyle = border-bottom: #aaa 1px solid", as I have done here. Frietjes (talk) 17:17, 22 September 2011 (UTC)
 * Thanks ... that's just what I was looking for.  Can anyone else render an opinion as to whether those lines are beneficial for users?   Or am I the only one that thinks they are an improvement?  Not that I would suggest making that the default for all Collapsible sidebars, but I may suggest it for the MOS sidebar. --Noleander (talk) 17:56, 22 September 2011 (UTC)

Definition of parameters?
...also, shouldn't the Template page here define the purpose and usage of some of the parameters, such as: headingstyle , contentstyle  , heading1. It is not clear where an editor would go to find out what purpose those parameters serve. Also, shouldn't the Template page here include an example template so a casual reader could see what this template looks like? Or is that discouraged? --Noleander (talk) 14:00, 22 September 2011 (UTC)
 * Yes, documentation is always good, and I agree we need more. Frietjes (talk) 17:17, 22 September 2011 (UTC)
 * Okay. I'm not too familiar with template documentation: I thought perhaps the Template page was intended to be ultra brief. I'd be happy to help out with improving this page:  can you steer me to where I might get some info on  headingstyle , contentstyle  , heading1?  I presume they are shared with another template ... maybe I can just grab it from there, or at least add a link to the other location. --Noleander (talk) 18:07, 22 September 2011 (UTC)
 * The documentation for template:sidebar is more complete than the documentation for this template, and almost all (if not all) of the parameters used there work here too. So, I guess one could start from that one as a guide and then just augment it with the extra stuff for this one.  I could take a crack at it, but probably not for several days, since things are very busy for me today.  go ahead if you feel up to it. Frietjes (talk) 20:28, 22 September 2011 (UTC)

Help!
Can someone please collapse this template– Template:Hindu philosophy ? --Tito Dutta ✉  14:42, 23 June 2012 (UTC)

horizontal rules
would it be possible to get leading horizontal rules to work with the  hack? The basic content sections don't have this problem. Frietjes (talk) 00:14, 26 March 2013 (UTC)

Blank line following the collapsible list
I hope I am asking this on the correct talk page. I'm speculating the following problem may originate with this template. There is a blank line between the "[show]" button and the " V * T * E  " links that appears after the collapsible list on the opera composer navboxes, e.g., Template:Verdi operas. Does anyone understand why? Does it really need to be there? It would be nice if it could be removed. Thanks for help! --Robert.Allen (talk) 07:11, 8 July 2013 (UTC)
 * the spacing can be controlled by adding padding statements to navbarstyle, contentstyle and liststyle. I reduced it with [//en.wikipedia.org/w/index.php?title=Template%3AComposer_navbox&diff=563401166&oldid=544679161 this edit].  Frietjes (talk) 17:20, 8 July 2013 (UTC)
 * Thanks so much! That's perfect! (I could never have figured this out on my own.) --Robert.Allen (talk) 08:40, 9 July 2013 (UTC)

listtitleclass
Is this missing..? (For sake of e.g. navbox-abovebelow, etc.) Sardanaphalus (talk) 10:34, 17 April 2014 (UTC)
 * There is no such thing as a 'listtitleclass'. Perhaps you are looking for 'headingclass'? — Edokter  ( talk ) — 10:57, 17 April 2014 (UTC)
 * Perhaps I am – but, since this template uses parameters called listNtitle, perhaps there should be a listtitleclass option..? Sardanaphalus (talk) 14:52, 24 April 2014 (UTC)

Case insensitivity for listnames
I'd like to add case insensitivity to this template's use of listnames to determine if/when a list is shown expanded – i.e. so that 95% is treated as if 95% and vice versa – and would've started with {{lc:}} in mind. Unfortunately, however, I'm not familiar with Lua, so would someone who is please oblige..?

I'd also started adding headingNclass and contentNclass parameters to a copy of the wiki/HTML-style Sidebar code, but I imagine that's not worth finishing now..?

Sardanaphalus (talk) 20:37, 5 May 2014 (UTC)

Template generating errors
As often as not today, pages that include this template or those which make use of it, such as Template:Classical mechanics, are displaying the error Script error: The function "collapsible" does not exist. instead of a proper sidebar. Intermittently replicated on Moment (physics), Acceleration, and most recently in three places on Template:Sidebar with collapsible lists, under Firefox 33.1.1 and Google Chrome 38.0.2125.111 on Windows 8.1 with 53% RAM available (and many tabs open in both browsers, so perhaps it's a resource/rendering issue?) —KGF0 ( T | C ) 03:21, 25 November 2014 (UTC)
 * KGF0, probably due to one of [//en.wikipedia.org/w/index.php?title=Module:Sidebar&action=history the more recent changes], which has hopefully been fixed. Frietjes (talk) 15:43, 25 November 2014 (UTC)

Protected edit request on 12 February 2015
Botteville (talk) 10:10, 12 February 2015 (UTC) On boxes of this type, such anthropolgy, if you click the e you do not get to the anthropology template, you get to this page instead. Chances are, people are only interested in modifying the content of the lists. What you seem to be saying is, you can't do that. This is a misrepresentation. You can too do that. I just did it. What this means is, people will not modify the content of the box to reflect the current articles. Not a good idea. Botteville (talk) 10:10, 12 February 2015 (UTC)
 * Red question icon with gradient background.svg Not done: it's not clear what changes you want to be made. Please mention the specific changes in a "change X to Y" format. —  13:30, 12 February 2015 (UTC)
 * What means is that on the page Anthropology, in the sidebar at upper right (which is ), there are some v-t-e links (i.e. a navbar) at the bottom, which link to Template:Sidebar with collapsible lists, Template talk:Sidebar with collapsible lists and [//en.wikipedia.org/w/index.php?title=Template:Sidebar_with_collapsible_lists&amp;action=edit] respectively, whereas they should link to Template:Anthropology, Template talk:Anthropology and [//en.wikipedia.org/w/index.php?title=Template:Anthropology&action=edit]. The problem on that specific sidebar arose with  by . It can be fixed by adding Anthropology to Template:Anthropology inside the, but the problem shouldn't exist. When a  has no name parameter, no navbar is shown; so when a  has no name parameter, a navbar should similarly not be shown - but it is, and it is the wrong navbar. -- Red rose64 (talk) 14:01, 12 February 2015 (UTC)
 * Thank you, I know understand the scope of the problem and think I have worked out the solution on Module:Sidebar/sandbox. I'm reluctant to apply that change myself as I struggle with Lua as much as you seem to and I would feel much better if maybe or one of our other Lua folks looks it over first.  Thanks. —   15:15, 12 February 2015 (UTC)
 * I updated Module:Sidebar to not show a navbar if it doesn't know the template's name. Note, however, that it is capable of autodetecting the template's name as long as no wrapper templates are used. I've now set this template up like that. Jackmcbarn (talk) 20:35, 12 February 2015 (UTC)
 * Seems to have been fixed now. Thank you everyone for your swift and definitive actions.Botteville (talk) 07:34, 13 February 2015 (UTC)

Need help with this template on a local wiki
Hi, I am working on a local wiki and i would like the "Show" collapse link to be shown at the left of the template like the fa.wiki or arabic which the reading and writing format is from right to left unlike english. Any help appreciated. Thanks--Glacious (talk) 05:43, 1 September 2015 (UTC)
 * Styling for show/hide buttons is at line 334 of your dv:MediaWiki:Common.css (take a look how it's done at line 354 of fa:MediaWiki:Common.css) and you can translate the show/hide buttons at line 175 and 176 of your dv:MediaWiki:Common.js. Also line 253 on dv:Module:Sidebar needs to be switch to left. --Lam-ang (talk) 07:02, 8 September 2015 (UTC)
 * ، it wouldnt help. Something else seems to be missing. I even tried copying the whole stuff needed from fa.wiki.--Glacious (talk) 03:15, 18 September 2015 (UTC)
 * line 1038 - right and line 1061 - left of your dv:MediaWiki:Common.css. --Lam-ang (talk) 05:19, 18 September 2015 (UTC)
 * , nope. Wouldnt change a bit.--Glacious (talk) 08:34, 18 September 2015 (UTC)

Looks like it's working here.--Lam-ang (talk) 14:37, 18 September 2015 (UTC)

Automated list expansion
Hello, I just worked out how to get this template to show whichever list the link to a page appears in when on that page and it strikes me that it's the kind of thing that could/ought to be made automatic – IF (pagename) EQUALS one of the links in the template THEN show the list including that link – or have I missed how to trigger this? 217.46.75.11 (talk) 22:33, 14 November 2015 (UTC)
 * I wish this was done too. – Finnusertop (talk ⋅ contribs) 21:26, 21 April 2016 (UTC)
 * Three years later, I still want this done. – Finnusertop (talk ⋅ contribs) 12:17, 2 August 2019 (UTC)
 * Finnusertop, try asking at WT:LUA or Module talk:Sidebar since it would require heavy string processing in Module:Sidebar. Frietjes (talk) 14:36, 2 August 2019 (UTC)

Use mw-collapsible instead
I've made a change to the module which implements  instead. The test cases look reasonable (though there is a minor change). Should there be more cases checked? Or is this a reasonably trivial change? --Izno (talk) 18:50, 30 June 2020 (UTC)
 * A followup: I have done this and more in the sandbox now, documented at Module talk:Sidebar. --Izno (talk) 01:02, 2 January 2021 (UTC)

Highlighting the expanded section and auto-expanding
Hi, the "expanded section" might have a different color (e.g., yellow etc.) or we can use other highlighting techniques to make the location of the article more clear. I think this way, instances of this sidebar become more readable.

Too, this expanding can be done automatically, i.e., via a simple comparison of "all hyperlinks existing in the template" and "title of the article in which this template is transcluded", I think this task does not require much processing. Thanks, Hooman Mallahzadeh (talk) 03:26, 14 July 2021 (UTC)

Remove redundant words "show" and "hide"
Hi, nowadays in modern user interfaces (UIs) the signs of "˅" and "˄" is nearly always used instead of the words "show" and "hide", so this convention should be applied in this template too. One of its benefit is that the template becomes neater and more lightweight and this improve "usability" (a quality feature) of this template and also total Wikipedia. Thanks, Hooman Mallahzadeh (talk) 05:26, 2 October 2021 (UTC)
 * Don't disagree with that for certain. The symbols are widely used now. Don't see how this can be changed in a single template series and module series, though. It appears to be a function of the Mediawiki software. You might want to try Phabricator to see if the developers have anything to say about it.  P.I. Ellsworth &numsp;- ed.  put'r there 05:46, 2 October 2021 (UTC)


 * did a Phab search and it appears that your idea has not yet been presented there, so as an original idea it just might fly. If you decide to test the devs on this, be patient with them because they're always pretty swamped with bug reports and such. Best to you!  P.I. Ellsworth &numsp;- ed.  put'r there 06:02, 2 October 2021 (UTC)
 * A new task created in Phabricator, here: https://phabricator.wikimedia.org/T292328, Thanks again, Hooman Mallahzadeh (talk) 06:56, 2 October 2021 (UTC)
 * thank you for the heads up! Left an added note there in support of your idea. Hope other editors will also.  P.I. Ellsworth &numsp;- ed.  put'r there 07:39, 2 October 2021 (UTC)
 * This proposal was discussed at VPT permalink where it has not been popular. Johnuniq (talk) 22:48, 7 October 2021 (UTC)

Sidebar disappearing in mobile view
Also asked here and here Chrisdevelop (talk) 02:54, 30 November 2023 (UTC)


 * It's intentional, see WP:SIDEBAR. fgnievinski (talk) 05:17, 4 February 2024 (UTC)

For the section the page is in, toggle on show
Generally speaking, I think the default state of the template should be with the section which the page is in toggled on 'show'. So for Trumpism and the neo-fascism template, toggle on show "Varieties" by default. This makes the template's relevance to the page much more understandable for the reader. Alexanderkowal (talk) 21:20, 3 May 2024 (UTC)


 * Is it possible for someone to change a bit of code to make this happen? Alexanderkowal (talk) 21:22, 3 May 2024 (UTC)