Template:Hide: Difference between revisions

From EarthMC
Jump to navigation Jump to search
mNo edit summary
Tag: Reverted
m (Undo revision 229189 by 924819012037263471 (talk))
Tag: Undo
 
Line 1: Line 1:
<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}}}"|}}>
<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}}}"|}}>
<tr>
<tr>
<th>{{{title|{{#ifeq:{{{1}}}|show|{{{2|}}}|{{{1|{{{text|}}}}}}}}}}}</th>
<th>{{{title|{{#ifeq:{{{1}}}|show|{{{2|}}}|{{{1|}}}}}}}}</th>
</tr>
</tr>
<tr>
<tr>

Latest revision as of 10:34, 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 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