Template:CategoryHeader: Difference between revisions
Template page
More actions
No edit summary |
Add <templatedata> for Visual Editor Usage. |
||
| Line 1: | Line 1: | ||
<div style="margin-bottom: 20px;"><div style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 4px 4px 0 0; padding: 24px; border-bottom: none;"><div style="display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px;"><div style="flex: 1; min-width: 300px;"><div style="font-size: 1.8em; font-weight: 800; color: var(--color-base); margin-bottom: 4px; letter-spacing: -0.01em;">{{{title|{{PAGENAME}}}}}</div><div style="font-size: 0.9em; color: var(--wiki-primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;">{{{subtitle|}}}</div>{{#if:{{{description|}}}|<div style="font-size: 1em; color: var(--color-base); line-height: 1.6; max-width: 850px; opacity: 0.9;">{{{description}}}</div>|}}</div>{{#if:{{{category|}}}|<div style="background: var(--color-surface-2); border: 1px solid var(--border-color-base); padding: 16px 24px; border-radius: 4px; text-align: center; min-width: 140px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.03); flex-shrink: 0;"><div style="font-size: 0.7em; text-transform: uppercase; font-weight: 800; color: var(--color-base--subtle); letter-spacing: 0.08em; margin-bottom: 4px;">Projects</div><div style="font-size: 2em; font-weight: 900; color: var(--color-base); line-height: 1;">{{PAGESINCATEGORY:{{{category}}}|pages}}</div></div>|}}</div></div><div style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 0 0 4px 4px; padding: 12px 24px; border-top: none; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 0.85em;"><span style="color: var(--color-base--subtle);">{{#if:{{{hub|}}}|[[{{{hub}}}|<span style="color: var(--wiki-primary); font-weight: 700;">← Back to Hub</span>]]{{#if:{{{links|}}}| · |}}}}{{{links|}}}</span></div></div><noinclude> | <div style="margin-bottom: 20px;"><div style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 4px 4px 0 0; padding: 24px; border-bottom: none;"><div style="display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px;"><div style="flex: 1; min-width: 300px;"><div style="font-size: 1.8em; font-weight: 800; color: var(--color-base); margin-bottom: 4px; letter-spacing: -0.01em;">{{{title|{{PAGENAME}}}}}</div><div style="font-size: 0.9em; color: var(--wiki-primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;">{{{subtitle|}}}</div>{{#if:{{{description|}}}|<div style="font-size: 1em; color: var(--color-base); line-height: 1.6; max-width: 850px; opacity: 0.9;">{{{description}}}</div>|}}</div>{{#if:{{{category|}}}|<div style="background: var(--color-surface-2); border: 1px solid var(--border-color-base); padding: 16px 24px; border-radius: 4px; text-align: center; min-width: 140px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.03); flex-shrink: 0;"><div style="font-size: 0.7em; text-transform: uppercase; font-weight: 800; color: var(--color-base--subtle); letter-spacing: 0.08em; margin-bottom: 4px;">Projects</div><div style="font-size: 2em; font-weight: 900; color: var(--color-base); line-height: 1;">{{PAGESINCATEGORY:{{{category}}}|pages}}</div></div>|}}</div></div><div style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 0 0 4px 4px; padding: 12px 24px; border-top: none; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 0.85em;"><span style="color: var(--color-base--subtle);">{{#if:{{{hub|}}}|[[{{{hub}}}|<span style="color: var(--wiki-primary); font-weight: 700;">← Back to Hub</span>]]{{#if:{{{links|}}}| · |}}}}{{{links|}}}</span></div></div><noinclude> | ||
== CategoryHeader == | == CategoryHeader == | ||
Displays a styled header for category pages | Displays a styled header for category pages with an optional live count badge, back-to-hub link, and footer navigation links. | ||
=== Usage === | === Usage === | ||
| Line 22: | Line 22: | ||
; <code>hub</code> : If provided, shows a "← Back to Hub" link in the footer bar linking to this page. | ; <code>hub</code> : If provided, shows a "← Back to Hub" link in the footer bar linking to this page. | ||
; <code>links</code> : Optional additional wikitext links shown in the footer bar, separated by <code>&nbsp;·&nbsp;</code>. | ; <code>links</code> : Optional additional wikitext links shown in the footer bar, separated by <code>&nbsp;·&nbsp;</code>. | ||
<templatedata> | |||
{ | |||
"description": "Displays a styled header for category pages, with an optional live count badge, back-to-hub link, and footer navigation links.", | |||
"params": { | |||
"title": { | |||
"label": "Title", | |||
"description": "Page heading. Defaults to {{PAGENAME}}.", | |||
"type": "string", | |||
"default": "{{PAGENAME}}", | |||
"required": false | |||
}, | |||
"subtitle": { | |||
"label": "Subtitle", | |||
"description": "Optional orange uppercase subtitle displayed below the title.", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"description": { | |||
"label": "Description", | |||
"description": "Optional body text paragraph shown under the subtitle.", | |||
"type": "content", | |||
"required": false | |||
}, | |||
"category": { | |||
"label": "Category name", | |||
"description": "If provided, shows a live page count badge using PAGESINCATEGORY for this category (e.g. Tutorials/Audio).", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"hub": { | |||
"label": "Hub page", | |||
"description": "If provided, shows a ← Back to Hub link in the footer bar pointing to this wiki page.", | |||
"type": "wiki-page-name", | |||
"required": false | |||
}, | |||
"links": { | |||
"label": "Extra footer links", | |||
"description": "Optional additional wikitext links shown in the footer bar.", | |||
"type": "content", | |||
"required": false | |||
} | |||
}, | |||
"format": "block" | |||
} | |||
</templatedata> | |||
[[Category:Layout Templates]] | [[Category:Layout Templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 08:26, 23 March 2026
CategoryHeader
CategoryHeader
Displays a styled header for category pages with an optional live count badge, back-to-hub link, and footer navigation links.
Usage
{{CategoryHeader
| title = Audio Tutorials
| subtitle = Step-by-step guides for audio production
| description = All tutorials covering audio topics — recording, mixing, synthesis, and more.
| category = Tutorials/Audio
| hub = Tutorials
| links = [[Special:PrefixIndex/Tutorials/Audio|Browse all →]]
}}
Parameters
title- Page heading. Defaults to
CategoryHeader. subtitle- Optional orange uppercase subtitle below the title.
description- Optional body text paragraph.
category- If provided, shows a live page count badge using
PAGESINCATEGORYfor this category name. hub- If provided, shows a "← Back to Hub" link in the footer bar linking to this page.
links- Optional additional wikitext links shown in the footer bar, separated by
· .
Displays a styled header for category pages, with an optional live count badge, back-to-hub link, and footer navigation links.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | title | Page heading. Defaults to {{PAGENAME}}.
| String | optional |
| Subtitle | subtitle | Optional orange uppercase subtitle displayed below the title. | String | optional |
| Description | description | Optional body text paragraph shown under the subtitle. | Content | optional |
| Category name | category | If provided, shows a live page count badge using PAGESINCATEGORY for this category (e.g. Tutorials/Audio). | String | optional |
| Hub page | hub | If provided, shows a ← Back to Hub link in the footer bar pointing to this wiki page. | Page name | optional |
| Extra footer links | links | Optional additional wikitext links shown in the footer bar. | Content | optional |