Template:Hide

From EarthMC
Revision as of 16:26, 28 December 2022 by 181cm (talk | contribs) (Fix Text)
Jump to navigation Jump to search

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 List
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 isshow, the content will be expanded by default:
    1. At this time, if there is no parametertitle, the nameless parameter value of the 2 will be used as the title part;
    2. At this time, if there is no parametercontent, the unnamed parameter value of the 3 will be used as the content part;
  • If the first nameless parameter value Not isshow:
    1. At this time, if there is no parametertitle, the unnamed parameter value of the 1 will be used as the title part;
    2. At this time, if there is no parametercontent, the unnamed parameter value of the 2 will be used as the content part.

Example of use

Basic example

{{Hide|You Know|*Test|expandtext=Do you really want to see it?|collapsetext=Actually, nothing}}
You Know
  • Test


Picture example

{{Hide|File:Komeiji Koishi test.jpg|[[File:Komeiji Koishi test.jpg]]}}
File:Komeiji Koishi test.jpg

Komeiji Koishi test.jpg

{{Hide|[[File:0Kpr68sa.png|100px]]|this is File:0Kpr68sa.png}}
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

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