Jump to content

Template:Hub card: Difference between revisions

From The Perfect Tower II
Fix
No edit summary
 
Line 1: Line 1:
<div class="tpt-card wiki-card {{#if:{{{facility|}}}|tpt-fac-{{{facility}}}}}"><div class="tpt-card__head">{{#if:{{{mark|}}}|<span class="tpt-hex tpt-hex--s"><span class="tpt-hex__mark">{{{mark}}}</span></span>}}{{#if:{{{icon|}}}|<span class="wiki-card__icon">[[File:{{{icon}}}|32px|link=|alt=]]</span>}}<div class="tpt-card__title">{{#if:{{{url|}}}|[{{{url}}} {{{title|}}}]|[[{{{link|{{{title|}}}}}}|{{{title|{{{link|}}}}}}]]}}</div></div>{{#if:{{{text|}}}|<div class="tpt-card__text">{{{text}}}</div>}}{{#if:{{{meta|}}}|<div class="tpt-card__meta">{{{meta}}}</div>}}</div><noinclude>
<div class="tpt-card wiki-card {{#if:{{{facility|}}}|tpt-fac-{{{facility}}}}}">{{#if:{{{image|}}}|<div class="tpt-card__media">[[File:{{{image}}}|400px|link=|alt=]]</div>}}<div class="tpt-card__head">{{#if:{{{mark|}}}|<span class="tpt-hex tpt-hex--s"><span class="tpt-hex__mark">{{{mark}}}</span></span>}}{{#if:{{{icon|}}}|<span class="wiki-card__icon">[[File:{{{icon}}}|32px|link=|alt=]]</span>}}<div class="tpt-card__title">{{#if:{{{url|}}}|[{{{url}}} {{{title|}}}]|[[{{{link|{{{title|}}}}}}|{{{title|{{{link|}}}}}}]]}}</div></div>{{#if:{{{text|}}}|<div class="tpt-card__text">{{{text}}}</div>}}{{#if:{{{meta|}}}|<div class="tpt-card__meta">{{{meta}}}</div>}}</div><noinclude>
A card that links to a page, in the TPT2 brand kit's style (<code>tpt-card</code>). Put cards inside [[Template:Hub grid]], which loads their styles; the whole card is clickable.
A card that links to a page, in the TPT2 brand kit's style (<code>tpt-card</code>). Put cards inside [[Template:Hub grid]], which loads their styles; the whole card is clickable.


Line 5: Line 5:
{{Hub card|title=Laboratory|facility=laboratory|mark=VI|text=Twelve experiments that unlock modules.|meta=Max. tier VI}}
{{Hub card|title=Laboratory|facility=laboratory|mark=VI|text=Twelve experiments that unlock modules.|meta=Max. tier VI}}
{{Hub card|title=Module database|url=https://www.perfecttower2.com/tools/modules/|text=Search all modules.|meta=Official}}
{{Hub card|title=Module database|url=https://www.perfecttower2.com/tools/modules/|text=Search all modules.|meta=Official}}
{{Hub card|title=Forest|mark=01|image=Forest.png|text=Open from the start.|meta=4 lanes}}
}}</pre>
}}</pre>


Line 19: Line 20:
"facility": { "label": "Facility", "description": "Building color: power-plant, mine, factory, headquarters, arcade, laboratory, shipyard, trading-post, workshop, museum, construction-firm or statue-of-cubos", "type": "string" },
"facility": { "label": "Facility", "description": "Building color: power-plant, mine, factory, headquarters, arcade, laboratory, shipyard, trading-post, workshop, museum, construction-firm or statue-of-cubos", "type": "string" },
"mark": { "label": "Hexagon mark", "description": "Short text in a hexagon badge, e.g. a tier", "type": "string" },
"mark": { "label": "Hexagon mark", "description": "Short text in a hexagon badge, e.g. a tier", "type": "string" },
"icon": { "label": "Icon", "description": "Small image next to the title", "type": "wiki-file-name" }
"icon": { "label": "Icon", "description": "Small image next to the title", "type": "wiki-file-name" },
"image": { "label": "Image", "description": "A 16:9 picture across the top of the card, such as a region screenshot", "type": "wiki-file-name" }
}
}
}
}
</templatedata>
</templatedata>
</noinclude>
</noinclude>

Latest revision as of 23:01, 6 October 2026

[[|]]

A card that links to a page, in the TPT2 brand kit's style (tpt-card). Put cards inside Template:Hub grid, which loads their styles; the whole card is clickable.

{{Hub grid|
{{Hub card|title=Laboratory|facility=laboratory|mark=VI|text=Twelve experiments that unlock modules.|meta=Max. tier VI}}
{{Hub card|title=Module database|url=https://www.perfecttower2.com/tools/modules/|text=Search all modules.|meta=Official}}
{{Hub card|title=Forest|mark=01|image=Forest.png|text=Open from the start.|meta=4 lanes}}
}}

A linked card for hub pages and the Main Page.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Titletitle

no description

Stringrequired
Pagelink

Wiki page to link; defaults to the title

Page nameoptional
External URLurl

Links outside the wiki instead of to a page

URLoptional
Texttext

One short sentence

Stringsuggested
Meta linemeta

Small uppercase line at the bottom

Stringoptional
Facilityfacility

Building color: power-plant, mine, factory, headquarters, arcade, laboratory, shipyard, trading-post, workshop, museum, construction-firm or statue-of-cubos

Stringoptional
Hexagon markmark

Short text in a hexagon badge, e.g. a tier

Stringoptional
Iconicon

Small image next to the title

Fileoptional
Imageimage

A 16:9 picture across the top of the card, such as a region screenshot

Fileoptional