Template:Hide: Difference between revisions
m (Fix Text) |
mNo edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
<table class="mw-collapsible {{#ifeq:{{#switch:show|{{{show|}}}|{{{1|}}}=true|#default=false}}|true||mw-collapsed}} wikitable" {{#if:{{{width|}}}|style="width: {{{width}}}"}} {{#if:{{{expandtext|}}}|data-expandtext="{{{expandtext}}}"|}} {{#if:{{{collapsetext|}}}|data-collapsetext="{{{collapsetext}}}"|}}> | <table class="mw-collapsible {{#ifeq:{{#switch:show|{{{show|}}}|{{{1|{{{text|}}}}}}=true|#default=false}}|true||mw-collapsed}} wikitable" {{#if:{{{width|}}}|style="width: {{{width}}}"}} {{#if:{{{expandtext|}}}|data-expandtext="{{{expandtext}}}"|}} {{#if:{{{collapsetext|}}}|data-collapsetext="{{{collapsetext}}}"|}}> | ||
<tr> | <tr> | ||
<th>{{{title|{{#ifeq:{{{1}}}|show|{{{2|}}}|{{{1|}}}}}}}}</th> | <th>{{{title|{{#ifeq:{{{1}}}|show|{{{2|}}}|{{{1|{{{text|}}}}}}}}}}}</th> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Revision as of 09:32, 11 September 2023
This template is derived from Moegirl Encyclopedia, and I translated it into English and did some processing.
This template is used to hide one paragraph of text/pictures/tables and add titles to them.
Usage
| Parameter name | Explain |
|---|---|
| show | When the parameter content isshow, the content will be expanded by default.
|
| title | Title section of the table |
| content | Contents section of the table |
| width | Specify the length of the table |
| expandtext | Customize the text description of "Unfold" |
| collapsetext | Customize the text description of "Collapse" |
Some parameters can be omitted. The rules are as follows:
- If the value of the first nameless parameter is
show, the content will be expanded by default:- At this time, if there is no parameter
title, the nameless parameter value of the 2 will be used as the title part; - At this time, if there is no parameter
content, the unnamed parameter value of the 3 will be used as the content part;
- At this time, if there is no parameter
- If the first nameless parameter value Not is
show:- At this time, if there is no parameter
title, the unnamed parameter value of the 1 will be used as the title part; - At this time, if there is no parameter
content, the unnamed parameter value of the 2 will be used as the content part.
- At this time, if there is no parameter
Example of use
Basic example
{{Hide|You Know|*Test|expandtext=Do you really want to see it?|collapsetext=Actually, nothing}}
| You Know |
|---|
|
Picture example
{{Hide|File:Komeiji Koishi test.jpg|[[File:Komeiji Koishi test.jpg]]}}
| File:Komeiji Koishi test.jpg |
|---|
{{Hide|[[File:0Kpr68sa.png|100px]]|this is File:0Kpr68sa.png}}
|
this is File:0Kpr68sa.png |
Example of the 'show' parameter
{{Hide
|title=File:Komeiji Koishi test.jpg
|content=
[[File:Komeiji Koishi test.jpg|100px]]
|show=show
}}
| File:Komeiji Koishi test.jpg |
|---|
{{hide
|title=Example
|content=Auto display hide template
|show
}}
| Example |
|---|
|
Auto display hide template |
- To sum up, using any of
|show=showor|showin the template will automatically display hidden content, while the writing method of|show=will not automatically display hidden content. (Note the equal sign after the show parameter)
Template Embedded Table
If you directly use a wiki table in this template, errors will occur because the vertical line|in the wiki table is incorrectly identified as the partition line of a parameter (for example,{{Hide||-}}will be identified as{{Hide|(no parameter)|(parameter: -)}})
Solution 1: Please use
{{!}}to replace|in the table, and{{!!}}to replace||in the table.
Solution 2: Instead of using {{hide}}, manually addclass="mw collectible mw collectible wikitable"
The code example is as follows:
{| class="mw-collapsible mw-collapsed wikitable"
|-
! Skill Name !! Effect
|-
| '''Tocca''' || 「Fight」 Uses ribbons to attack. You have a chance to make the opponent enter the "bound" state
|-
| '''Tocca Spirale''' || 「Fight」Turn the ribbon into a spiral and attack the front
|}
The effect is as follows:
| Skill Name | Effect |
|---|---|
| Tocca | 「Fight」 Uses ribbons to attack. You have a chance to make the opponent enter the "bound" state |
| Tocca Spirale | 「Fight」Turn the ribbon into a spiral and attack the front |
