Terraria Wiki
注册
Advertisement
Template-info Documentation The documentation below is transcluded from Template:Infocard/doc. (edit | history)

Used to make a info card.

Usage[]

color= and/or theme=

The 'Theme' color for this card. Can be any valid CSS color(e.g. #E4F0F7, red, rgba(0,0,0,0.3)), or one of the following shoutcut keywords: melee(    ), magic/mage(    ), ranged/ranger(    ), summoning/summon/summoner(    ), terraria(    ). If omitted, the default value is #AFCFE2(    ).

color= will only apply to all main titles, and theme= will apply to main titles and all titles of sub boxes.

image=<filename> or imagealt=<wikitext>

Image info for the "minicard".See the diagram and examples below. Only one of them will be used, and {{{image}}} take priority.

icon=<filename> or iconalt=<wikitext>

Icon info for the "minicard".See the examples below.

size=

The width of the "minicard" (without border), The Default value is 250px. If {{{image}}} is used, the value for {{{size}}} must in px, e.g. 250px. If {{{imagealt}}} is specified, the value can be any valid CSS length.

other paramaters
{{{image}}} or {{{imagealt}}}
{{{icon}}} or {{{iconalt}}}
(see details below)

{{{cardintro}}}

{{{card_<key1>}}}
{{{<key1>}}}
{{{card_<key2>}}}
{{{<key2>}}}
...
...

{{{cardoutro}}}

{{{type}}}
{{{name}}} {{{namenote}}}
{{{subname}}}

{{{intro}}}

{{{title_<keyA>}}}

{{{<keyA>}}}

{{{title_<keyB>}}}

{{{<keyB>}}}

{{{title_<keyC>}}}

{{{<keyC>}}}

...

...

{{{outro}}} or {{{text}}}

Minicard mode vs Icon mode:

Code Result
Minicard mode
{{infocard
  |type=Mode
  |name=Minicard
  |image=Walkthrough Snow.png|size=200px
  |card_a=Title
  |a=Content
  |text=Text content.
}}
Walkthrough Snow
Title
Content
Mode
Minicard

Text content.

Custom minicard mode
{{infocard
  |type=Mode
  |name=Custom Minicard
  |imagealt=
    <div style="
        padding: 20px 20px 0;
        background:#61BBC2; 
        margin-bottom: -10px;">
    [[File:Moon Lord.png|160px|link=]]
    </div>
  |size=200px
  |card_a=Title
  |a=Content
  |text=Text content.
}}
Moon Lord
Title
Content
Mode
Custom Minicard

Text content.

Icon mode
{{infocard
  |type=Mode
  |name=Icon
  |icon=Bookcase (placed).png
  |text=Text content.
}}
Mode
Icon
Bookcase (placed)

Text content.

Custom icon mode
{{infocard
  |type=Mode
  |name=Custom Icon
  |iconalt=
    {{flexbox
      |css=width:80px;
           height:80px;
           background:#fff;
           border:1px solid #ccc;
           border-radius:100px;
      |alignitems=center
      |justify=center
      |[[File: Map Icon Moon Lord.png|link=]]
    }}
  |text=Text content.
}}
Mode
Custom Icon
Map Icon Moon Lord

Text content.

See Guide:Walkthrough for examples.

{{infocard/box}}[]

You can use {{{infocard/box}}} to create boxes in {{{intro}}} and {{{text}}} if needed. Note: The boxes created by {{{infocard/box}}} has no margin, and you may add margin: 1em 0 manually.

For example:

{{infocard
|type=Sample
|name=Boxes in text 
|intro=Intro start {{infocard/box|a box in intro}} Intro end
|title_box=Title
|box=
some text in box.
{{infocard/heading|Chapter Heading}}
Chapter text
|outro= 
Outro start
{{infocard/box|title=box title|box 1 in text}}
Some text
{{infocard/box|box 2 in text|css=background:#ffeeee;color:#ff0000}}
{{infocard/heading|More complicated layout:}}
{{flexstart|justify=justified|css=margin: -0.5em;}}
  {{infocard/box|box A|css=width: 200px;margin: 0.5em;}}
  {{infocard/box|box B|css=width: 200px;margin: 0.5em;}}
  {{infocard/box|box C|css=width: 200px;margin: 0.5em;}}
  {{infocard/box|box D|css=width: 200px;margin: 0.5em;}}
{{flexend}}
{{infocard/heading|Even nested:}}
{{infocard/box|css=background:#eeffee;
|title=Nested boxes
| {{flexstart|justify=justified|css=margin:-0.5em;}}
    {{infocard/box|box W|css=width: 250px;margin: 0.5em;}}
    {{infocard/box|title=X|box X|css=width: 250px;margin: 0.5em;}}
    {{infocard/box|box Y|css=width: 250px;margin: 0.5em;}}
    {{infocard/box|title=Z|box Z|css=width: 250px;margin: 0.5em;}}
  {{flexend}}
}}
You can change the "theme color" of boxes if needed:
{{flexstart|justify=justified|css=margin: -0.5em}}
  {{infocard/box|title=Melee|Melee box|css=width: 200px;margin: 0.5em;|color=melee}}
  {{infocard/box|title=Ranged|Ranged box|css=width: 200px;margin: 0.5em;|color=ranged}}
  {{infocard/box|title=Magic|Magic box|css=width: 200px;margin: 0.5em;|color=magic}}
  {{infocard/box|title=Summoning|Summoning box|css=width: 200px;margin: 0.5em;|color=summoning}}
  {{infocard/box|title=Other|Other box|css=width: 200px;margin: 0.5em;|color=#F7E268}}
{{flexend}}
Text end
}}

will render as:

Sample
Boxes in text
Intro start

a box in intro

Intro end
Title

some text in box.

Chapter Heading

Chapter text

Outro start

box title

box 1 in text

Some text

box 2 in text

More complicated layout:

box A

box B

box C

box D

Even nested:
Nested boxes

box W

X

box X

box Y

Z

box Z

You can change the "theme color" of boxes if needed:

Melee

Melee box

Ranged

Ranged box

Magic

Magic box

Summoning

Summoning box

Other

Other box

Text end

Options[]

This template supports options through {{options}} template. All valid options are listed below, see {{options}} for usage and other infomation.

See Template:infocard/initOptions for the initial options setting of this template.

NameAliasInitial ValueValue Mapping[1]Note
sizecardsize
minicardsize
250px
class(empty)
cssstyle
(empty)
color(empty)
theme(empty)
box-cssbox-style
(empty)Default css for {{infocard/box}}。
box-class(empty)
  1. Values with mapping will be stored and loaded as mapped value. Other values without mapping will be stored and loaded as-is.

Subpages[]

zh:Template:Infocard

Advertisement