Template:Portal Box: Difference between revisions

Created page with "<templatestyles src="Template:Portal Box/styles.css" /><div class="mw-portal-box{{#if:{{{colour|}}}| mw-portal-box-{{{colour}}}}}"><div class="mw-portal-box-title">{{{title|Section}}}</div><div class="mw-portal-box-content">{{{1|}}}</div></div><noinclude> == Usage == Wrap multiple boxes in a grid container on your portal page: <pre> <div class="mw-portal-grid"> {{Portal Box|title=DNS & Networking|colour=teal| * DNS servers * Envoy Gateway * Cilium * Netwo..."
 
m Fix formatting of the doc text
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<templatestyles src="Template:Portal Box/styles.css" /><div class="mw-portal-box{{#if:{{{colour|}}}| mw-portal-box-{{{colour}}}}}"><div class="mw-portal-box-title">{{{title|Section}}}</div><div class="mw-portal-box-content">{{{1|}}}</div></div><noinclude>
<templatestyles src="Template:Portal Box/styles.css" /><div class="infranav-section"><div class="infranav-heading">{{{title|Section}}}</div>{{{1|}}}</div><noinclude>
== Usage ==
== Usage ==


Wrap multiple boxes in a grid container on your portal page:
Wrap one or more boxes in a portal grid container on your page:


<pre>
<pre>
<div class="mw-portal-grid">
<div class="infranav infranav--portal">
{{Portal Box|title=DNS & Networking|colour=teal|
<div class="infranav-title">Infrastructure</div>
<div class="infranav-contents">
{{Portal Box|title=DNS & Networking|
* [[DNS servers]]
* [[DNS servers]]
* [[Envoy Gateway]]
* [[Envoy Gateway]]
Line 12: Line 14:
* [[Network subnets]]
* [[Network subnets]]
}}
}}
{{Portal Box|title=Kubernetes|colour=blue|
{{Portal Box|title=Kubernetes|
* [[Cluster overview]]
* [[Cluster overview]]
* [[Talos Linux]]
* [[Talos Linux]]
Line 18: Line 20:
* [[Longhorn storage]]
* [[Longhorn storage]]
}}
}}
{{Portal Box|title=Mail|colour=green|
{{Portal Box|title=Mail|
* [[Stalwart Mail]]
* [[Stalwart Mail]]
* [[Mailman]]
* [[DKIM keys]]
* [[DKIM keys]]
}}
}}
{{Portal Box|title=Monitoring|colour=purple|
{{Portal Box|title=Monitoring|
* [[VictoriaMetrics]]
* [[VictoriaMetrics]]
* [[Grafana]]
* [[Grafana]]
* [[Alertmanager]]
* [[Alertmanager]]
}}
}}
</div>
</div>
</div>
</pre>
</pre>


=== Colour options ===
Each <code><nowiki>{{Portal Box}}</nowiki></code> call renders one section card. The outer wrapper controls the overall box border, title bar, and flex grid.
{| class="wikitable"
 
! Value !! Header colour
Omit <code>&lt;div class="infranav-title"&gt;...&lt;/div&gt;</code> if you don't need a header bar above the grid.
|-
 
| (omit) || Blue (#3366cc)
== Styles ==
|-
 
| <code>green</code> || Dark green
The template's styles are defined in [[Template:Portal Box/styles.css]].
|-
| <code>teal</code>   || Teal
|-
| <code>purple</code> || Purple
|-
| <code>red</code>   || Dark red
|-
| <code>orange</code> || Orange
|-
| <code>grey</code>  || Slate grey
|}


<templatedata>
<templatedata>
{
{
     "description": "A single card for a portal-style grid navigation page. Wrap multiple cards in <div class=\"mw-portal-grid\">...</div>.",
     "description": "A single section card for a portal-style grid navigation box. Wrap multiple cards inside an infranav portal container.",
     "params": {
     "params": {
         "title": { "label": "Title",  "type": "string", "required": true, "description": "Heading shown in the card's coloured header bar." },
         "title": { "label": "Title",  "type": "string", "required": true, "description": "Heading shown above the card's content." },
        "colour": { "label": "Colour",  "type": "string", "suggestedvalues": ["green","teal","purple","red","orange","grey"], "description": "Header bar colour. Omit for default blue." },
         "1":     { "label": "Content", "type": "string", "required": true,  "description": "Card body — typically a wikitext bullet list of links." }
         "1":     { "label": "Content", "type": "string", "required": true,  "description": "Card body — typically a wikitext bullet list of links." }
     },
     },
     "format": "inline"
     "format": "inline"