Template:Hub card: Difference between revisions
Speedybrain (talk | contribs) Fix |
Speedybrain (talk | contribs) 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.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | title | no description | String | required |
| Page | link | Wiki page to link; defaults to the title | Page name | optional |
| External URL | url | Links outside the wiki instead of to a page | URL | optional |
| Text | text | One short sentence | String | suggested |
| Meta line | meta | Small uppercase line at the bottom | String | optional |
| Facility | facility | Building color: power-plant, mine, factory, headquarters, arcade, laboratory, shipyard, trading-post, workshop, museum, construction-firm or statue-of-cubos | String | optional |
| Hexagon mark | mark | Short text in a hexagon badge, e.g. a tier | String | optional |
| Icon | icon | Small image next to the title | File | optional |
| Image | image | A 16:9 picture across the top of the card, such as a region screenshot | File | optional |