Template talk:Collapse

From Wikimedia Commons, the free media repository
Jump to: navigation, search

class="collapsible collapsed navbox"[edit]

Where is this class described? What page has the code? I am curious to go there and watch its evolution, and learn some more. --Timeshifter (talk) 08:18, 17 August 2008 (UTC)

Well, the collapsible feature takes javascript so it's in MediaWIki:Common.js which imports MediaWiki:CollapsibleTables.js. The navbox class is just styling so it's in MediaWiki:Common.css. Rocket000(talk) 00:10, 18 August 2008 (UTC)
Thanks. I have a lot to study and learn. --Timeshifter (talk) 08:21, 18 August 2008 (UTC)
I've been meaning to do some documentation for these but never got around to it yet. Here's a start. Rocket000(talk) 09:36, 18 August 2008 (UTC)
Thanks. I bookmarked it. --Timeshifter (talk) 10:12, 18 August 2008 (UTC)

Font sizes[edit]

Can the default font size be changed to 95% or 100%. I assume it is at 90% now. Maybe a font size option can be created like the one for Template:On Wikipedia.

I find the text to be too small in this template I created: User:Timeshifter/Template:Diagrams charts graphs. It uses the {{Collapsed}} template inside it. Thanks again for creating Template:Collapsed. It may solve many problems on the Commons. --Timeshifter (talk) 11:46, 18 August 2008 (UTC)

I went with the standard size used all over en.wp. To me it looks the same size as the side bar links. Maybe it's your browser settings that making it look really small? Rocket000(talk) 13:00, 18 August 2008 (UTC)
OK. I agree that the text and links in a sidebar need to be small. Otherwise, lines of the text begin to wordwrap, and it looks bad and laddered. Also, the column can get too long. I am a basic webmaster too, and have noticed this problem with sidebars if the text is too large.
But this template is for main text in the center column, and so I suggest making the text a little larger. I would like to use this template for the non-English introductions found here:
So the English introduction would remain exposed, but the translations would be put in a {{Collapsed}} show/hide box under the English introduction. So it needs to be easily readable by any international reader with any level of visual acuity. Some languages are harder to read at smaller text sizes such as the ones with intricate characters such as Arabic, Persian, Hebrew, Chinese, Japanese, etc.. --Timeshifter (talk) 13:43, 18 August 2008 (UTC)
Ok, I dropped the navbox class and put the styling in directly so it can be changed. For example, you can do
I'm going to work on making new templates or possibly convert old ones like {{hidden}}. Rocket000(talk) 20:26, 23 August 2008 (UTC)
Great! Thanks again. It looks like there is a width parameter used in the above box. I went ahead and listed the width parameter in the instructions. Your instructions are very clear by the way. --Timeshifter (talk) 16:35, 24 August 2008 (UTC)
Thanks. Yeah, I didn't list all the parameters. I left out what I think will be the least used. People get confused if you throw too many instructions at them. :) But I should've include width as that will probably be used a lot. What I would really like is a way to change "show" and "hide" text. We can with javascript but that's not a good idea since a new class would need to be defined in the site's .js/.css for each template that uses a different word(s). I wish I knew more about javascript, there must be a way to allow users to define the words in the template itself. Rocket000(talk) 18:03, 24 August 2008 (UTC)
I think most people will figure it out since show/hide boxes exist in most Wikipedias, I believe. It is kind of intuitive with the open/close link there on the right side of them all, as far as I know. Maybe you can also put the small arrowheads used in some of the other show/hide templates, or the icon used at the top of columns in sortable tables. Or both. The more visual cues the better. --Timeshifter (talk) 19:12, 24 August 2008 (UTC)

Category:Félix Houphouët-Boigny[edit]

Category:Félix Houphouët-Boigny

I tried out the template for the category introduction. I left the English intro in the open, and put the rest in the show/hide box. See:

I noticed that unless I inserted 2 blank lines before the template code for the box, the box would show up too close to the text above it at Category:Félix Houphouët-Boigny. Using just one blank line did not seem to separate the box enough from the text above it. It seems to be because the previous text had template code brackets }} at the end. --Timeshifter (talk) 19:33, 24 August 2008 (UTC)

Yeah, that will happen when next to certain templates. For those cases, you can adjust the margin (usually margin=1em 0. Remember "margin" sets all sides so the 0 is needed to keep the left and right sides' margin the same. Rocket000(talk) 03:17, 28 August 2008 (UTC)

Showing contents by default[edit]

Could someone take a look at this and/or the associated js/css and add a way to give the template call a parameter which allows us to show content by default instead of hiding it by default? Thanks.  — Mike.lifeguard | @en.wb 23:42, 16 January 2009 (UTC)

I created {{collapsible}}. It could have easily been done with this template (they're basically identical) but I figured it would be easier to use both of these without another parameter to remember. Also, the name makes more sense. Rocket000(talk) 04:31, 17 March 2009 (UTC)
Oh well, restore it if you want it. Rocket000 (talk) 13:49, 15 April 2009 (UTC)


  • 1. Would it be possible to display title = {{PAGENAME}} by default ?
  • 2. I am under the impression that {{Collapsed}} with uppercase Title= does not work.
  • 3. Would it not be simpler if the first parameter is always the title ? --Foroa (talk) 12:04, 25 February 2010 (UTC)
    • 1. Sure, that way you only need title= to change it. How common is it to use {{PAGENAME}} as the title?
    • 2. All this template's parameters are lowercase. It's good idea to keep it this way since it helps make it a habit to always use lowercase for parameters. Many templates only allow lowercase (with notable exceptions like {{information}}).
    • 3. I forgot why I did it that way. You can change it if you want, but it would affect current usage since the "content" is {{{1}}}. Rocket000 (talk) 14:11, 25 February 2010 (UTC)
      • Ok, I see how you're using it. I set the default to {{PAGENAME}}. Now, it's actually good that the title param. is not the first. You can skip it completely. Rocket000 (talk) 15:16, 25 February 2010 (UTC)
        • Thank you. --Foroa (talk) 15:53, 25 February 2010 (UTC)

Version of 9 oct 2010[edit]

Seems pretty much improved but preview is no longer usable/testable. I.e. Category:Mbira, Category:Andrés Segovia. Category:Rolling stock is funny too. --Foroa (talk) 19:01, 17 October 2010 (UTC)

"Show all" does not work in preview and the collapse button is not available in preview. On average, from the various language descriptions provided by the toolserver, there are two or 3 invalid or needs some searching and tweeking. To have a better idea how we use collapse: Category_talk:Plaques#Multilingual_category_description and Category:Cépages. --Foroa (talk) 19:50, 17 October 2010 (UTC)