Difference between revisions of "Template:Collapsible"

From TFC:TNG
Jump to navigation Jump to search
(Testing template data.)
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
</div>
 
</div>
  
 +
<noinclude>
 +
=Template Data=
 
<templatedata>
 
<templatedata>
 
{
 
{
    "description": "A template for linking to a commons category about an article",
+
"description": "Template for adding 'spoiler' like content windows.",
    "params": {
+
"params": {
        "collapsed": {
+
"collapsed": {
            "label": "Commons category",
+
"label": "Collapsed",
            "description": "The commons category you want to link to.",
+
"description": "If this should be collapsed by default on load.",
            "default": "Category:CommonsRoot",
+
"type": "string",
            "type": "string",
+
"suggested": true
            "required": true
+
},
        }
+
"title": {
    }
+
"label": "Title",
 +
"description": "Bold, always shown on top of the template text.",
 +
"type": "line"
 +
},
 +
"alwaysshowncontent": {
 +
"label": "Always Shown Content",
 +
"description": "Content that is always shown in the box. This information can't be hidden.",
 +
"type": "content"
 +
},
 +
"hiddencontent": {
 +
"label": "Hidden Content",
 +
"description": "Content that can be hidden within the box.",
 +
"type": "content",
 +
"required": true
 +
}
 +
},
 +
"format": "block"
 
}
 
}
 
</templatedata>
 
</templatedata>
 +
=Examples=
 +
 +
<code><nowiki>{{Collapsible|collapsed=yes|alwaysshowncontent= You always see this! I can't be hidden!| hiddencontent= You only see this if you expanded me!}}</nowiki></code>
 +
 +
{{Collapsible|collapsed=yes|alwaysshowncontent= You always see this! I can't be hidden!| hiddencontent= You only see this if you expanded me!}}
 +
 +
<code><nowiki>{{Collapsible|title= This is a title!| hiddencontent= I'm always shown by default if collapsed is missing or empty!}}</nowiki></code>
 +
 +
{{Collapsible|title= This is a title!| hiddencontent= I'm always shown by default if collapsed is missing or empty!}}
 +
 +
<code><nowiki>{{Collapsible| hiddencontent= Sometimes you don't always want something so hide it all!}}</nowiki></code>
 +
 +
{{Collapsible| hiddencontent= Sometimes you don't always want something so hide it all!}}
 +
</noinclude>

Latest revision as of 04:12, 28 January 2020


Template Data

Template for adding 'spoiler' like content windows.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Collapsedcollapsed

If this should be collapsed by default on load.

Stringsuggested
Titletitle

Bold, always shown on top of the template text.

Lineoptional
Always Shown Contentalwaysshowncontent

Content that is always shown in the box. This information can't be hidden.

Contentoptional
Hidden Contenthiddencontent

Content that can be hidden within the box.

Contentrequired

Examples

{{Collapsible|collapsed=yes|alwaysshowncontent= You always see this! I can't be hidden!| hiddencontent= You only see this if you expanded me!}}

You always see this! I can't be hidden!
You only see this if you expanded me!


{{Collapsible|title= This is a title!| hiddencontent= I'm always shown by default if collapsed is missing or empty!}}

This is a title!
I'm always shown by default if collapsed is missing or empty!


{{Collapsible| hiddencontent= Sometimes you don't always want something so hide it all!}}

Sometimes you don't always want something so hide it all!