Difference between revisions of "Template:Collapsible"

From CWCki
Jump to navigation Jump to search
m (Collaspible boxes always seem to have an extra center tag that doesn't do anything. I'm taking this one off the the template to see if this gets rid of it.)
(Collapsible gallery classes corrected.)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| class="collapsible collapsed" style="border:1px solid #aaa; background-color:#f9f9f9; padding:5px; font-size:95%; clear:both; margin:0 auto; width:70%;"
{| class="mw-collapsible {{#ifeq:{{{state}}}|expanded||mw-collapsed}}" style="border:1px solid #aaa; background-color:#f9f9f9; padding:5px; font-size:95%; clear:both; margin:0 auto; width:75%;"
! style="background-color:#ccf;" | {{{1}}}
! style="background-color:#ccf;" | {{{1}}}
|-
|-
| {{{2}}}
| {{{2}}}
|}<noinclude>
|}<noinclude>{{Usage|1=This is a formatting template used to create collapsible boxes around content. This is especially useful for image galleries, navigation boxes, lists, and other sections that make a long article unwieldy. 
The format for using this template is as follows:


==How to use this template==
<nowiki>{{collapsible|title|content}}</nowiki>
 
-Displays: {{collapsible|title|content}}
 
You can have the table expanded by default, by setting “state” to “expanded”.
 
<nowiki>{{collapsible|state=expanded|title|content}}</nowiki>


;Format
-Displays: {{collapsible|state=expanded|title|content}}
<nowiki>{{collapsible|title|content}}</nowiki>
 
As an example, the following box will contain a gallery of Chris's homemade [[Yu-Gi-Oh!]] cards.


;Example
<pre><nowiki>
<pre><nowiki>
{{collapsible
{{collapsible
Line 32: Line 40:
</nowiki></pre>
</nowiki></pre>


;Result
-Displays:
{{collapsible
{{collapsible
|Chris's homemade ''[[Yu-Gi-Oh!]]'' cards
|Chris's homemade ''[[Yu-Gi-Oh!]]'' cards
Line 51: Line 59:
Image:146-Jerkop.jpg
Image:146-Jerkop.jpg
</gallery>}}
</gallery>}}
</noinclude>
}}
[[Category:Formatting and function templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 16:49, 24 May 2019

{{{1}}}
{{{2}}}

Usage

These usage notes will not be included in articles bearing this template.

This is a formatting template used to create collapsible boxes around content. This is especially useful for image galleries, navigation boxes, lists, and other sections that make a long article unwieldy.

The format for using this template is as follows:

{{collapsible|title|content}}

-Displays:

title
content

You can have the table expanded by default, by setting “state” to “expanded”.

{{collapsible|state=expanded|title|content}}

-Displays:

title
content

As an example, the following box will contain a gallery of Chris's homemade Yu-Gi-Oh! cards.

{{collapsible
|Chris's homemade ''[[Yu-Gi-Oh!]]'' cards
|<gallery perrow="5">
Image:104-GirlfriendAttract.jpg|example caption
Image:105-LonesomeSelf.jpg
Image:106-FrustratedVirgin.jpg|another caption
Image:107-HookedOnSonichu2.jpg
Image:108-PlanForAttraction.jpg
Image:109-CWCSpellsCard.jpg
Image:138-CurseYeHaMeHa.jpg
Image:139-CWCsDarkGlare.jpg
Image:140-AJerk.jpg
Image:141-JerksLoiteringLot.jpg
Image:142-QuizGirlfriend.jpg
Image:143-MaryLeeWalsh.jpg
Image:145-ShatteredHeart.jpg
Image:146-Jerkop.jpg
</gallery>}}

-Displays:

Chris's homemade Yu-Gi-Oh! cards