Template talk:Collapse

From Wikimedia Commons, the free media repository
Jump to navigation Jump to 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)[reply]

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)[reply]
Thanks. I have a lot to study and learn. --Timeshifter (talk) 08:21, 18 August 2008 (UTC)[reply]
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)[reply]
Thanks. I bookmarked it. --Timeshifter (talk) 10:12, 18 August 2008 (UTC)[reply]

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)[reply]

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)[reply]
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)[reply]
Ok, I dropped the navbox class and put the styling in directly so it can be changed. For example, you can do
Click 'show' to see the code.
{{collapsed|font-size=100%|width=80%|title=Click 'show' to see the code.|...}}
I'm going to work on making new templates or possibly convert old ones like {{Hidden}}. Rocket000(talk) 20:26, 23 August 2008 (UTC)[reply]
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)[reply]
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)[reply]
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)[reply]

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:


Introduction in other languages
Alemannisch: De Félix Houphouët-Boigny (* 18 oktober 1905 z'Yamoussoukro; † 7. dezember 1993) isch vo 1960 bis 1993 de erscht president vo Côte d'Ivoire gsy.
Asturianu: Félix Houphouët-Boigny ( 18 d'ochobre de 1905 - 7 d'avientu de 1993) foi'l primer presidente de Costa de Marfil. Ocupó esti cargu 33 años, dende la independencia del país , en 1960, hasta que morrió en 1993.
Čeština: Félix Houphouët-Boigny (* 18. října 1905 Yamoussoukro7. prosince 1993) byl v letech 19601993 prvním prezidentem afrického státu Pobřeží slonoviny.
Dansk: Félix Houphouët-Boigny ( 18. oktober 1905 i Yamoussoukro - 7. december 1993) var fra 1960 til 1993 den første præsident i landet Elfenbenskysten.
Deutsch: Félix Houphouët-Boigny (* 18. Oktober 1905 in Yamoussoukro; † 7. Dezember 1993) war von 1960 bis 1993 der erste Präsident der Elfenbeinküste.
Español: Félix Houphouët-Boigny ( Yamoussoukro, 1905-1993), fue el primer presidente de Costa de Marfil desde 1960 hasta su muerte en 1993.
Français : Félix Houphouët-Boigny ( 18 octobre 1905 ? à Yamoussoukro - 7 décembre 1993), premier président de la Côte d'Ivoire de 1960 à 1993.
Hrvatski: Félix Houphouët-Boigny ( Yamoussoukro, 18. listopada 1905. - Obala Bjelokosti, 7. prosinca 1993.), bivši afrički vođa, prvi predsjednik Obale Bjelokosti.
Bahasa Indonesia: Félix Houphouët-Boigny ( IPA: ) (18 Oktober 1905 - 7 Desember 1993) tampil pertama sebagai Presiden Pantai Gading (1960 - 1993) dan kemudian memimpin dalam pemerintahan Perancis pada periode 1957 - 1961.
Nederlands: Felix Houphouët-Boigny, eigenlijke naam Dia Houphouët ( Yamoussoukro, 18 oktober 1905 – Yamoussoukro, 7 december 1993) was een Ivoriaans politicus.
Polski: Félix Houphouët-Boigny (ur. 18 października 1905, zm. 7 grudnia 1993), polityk Wybrzeża Kości Słoniowej, pierwszy prezydent tego kraju od 3 listopada 1960 do swej śmierci. Szef państwa od 7 sierpnia do 3 listopada 1960.
Svenska: Félix Houphouët-Boigny född 18 oktober 1905, död 7 december 1993, var läkare och Elfenbenskustens första president 1960-1993.
中文:费利克斯·乌弗埃-博瓦尼法语 实行反共外交政策。

(This summary was created using Commons SumItUp)

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)[reply]

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)[reply]

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)[reply]

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)[reply]
Oh well, restore it if you want it. Rocket000 (talk) 13:49, 15 April 2009 (UTC)[reply]

Suggestions

[edit]
  • 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)[reply]
    • 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)[reply]

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)[reply]

"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)[reply]