Template:HubHeader: Difference between revisions
More actions
No edit summary  |
Add <templatedata> for Visual Editor Usage. |
||
| Line 37: | Line 37: | ||
; <code>subtitle</code> : Orange uppercase subtitle. Defaults to "Subtitle Text". | ; <code>subtitle</code> : Orange uppercase subtitle. Defaults to "Subtitle Text". | ||
; <code>description</code> : Optional body paragraph below the subtitle. | ; <code>description</code> : Optional body paragraph below the subtitle. | ||
; <code>category</code> : If provided, shows a live count badge using <code>PAGESINCATEGORY</code> | ; <code>category</code> : If provided, shows a live count badge using <code>PAGESINCATEGORY</code> (e.g. <code>Projects/Audio</code>). | ||
; <code>count_label</code> : Label above the count badge. Defaults to "Projects". | ; <code>count_label</code> : Label above the count badge. Defaults to "Projects". | ||
; <code>submit_form</code> : If provided, adds an orange "+ Submit" button linking to <code>Special:FormStart/FormName | ; <code>submit_form</code> : If provided, adds an orange "+ Submit" button linking to <code>Special:FormStart/FormName</code>. | ||
; <code>hub_path</code> : Path | ; <code>hub_path</code> : Path for the "Full Index" button. Defaults to current page name. | ||
; <code>hub_type</code> : Template name | ; <code>hub_type</code> : Template name for the "Templates" toolbar button. Defaults to "Project". | ||
; <code>license</code> : Default license shown in the metadata bar. Defaults to "CC-BY-SA 4.0". | ; <code>license</code> : Default license shown in the metadata bar. Defaults to "CC-BY-SA 4.0". | ||
=== Notes === | === Notes === | ||
* "Last Submission" and "Activity" in the metadata bar are populated by JavaScript gadgets | * "Last Submission" and "Activity" in the metadata bar are populated by JavaScript gadgets. | ||
* The toolbar links to [[Project:Submission Guidelines]], [[Project:Licenses]], the page's talk page, and [[Project:Community]] — create these pages to avoid red links. | * The toolbar links to [[Project:Submission Guidelines]], [[Project:Licenses]], the page's talk page, and [[Project:Community]] — create these pages to avoid red links. | ||
<templatedata> | |||
{ | |||
  "description": "Displays the full header block for a project or tutorial hub page, including title, count badge, toolbar, and a live metadata bar.", | |||
  "params": { | |||
    "title": { | |||
      "label": "Title", | |||
      "description": "Main heading for the hub page.", | |||
      "type": "string", | |||
      "default": "Title Text", | |||
      "required": false | |||
    }, | |||
    "subtitle": { | |||
      "label": "Subtitle", | |||
      "description": "Orange uppercase subtitle shown below the title.", | |||
      "type": "string", | |||
      "default": "Subtitle Text", | |||
      "required": false | |||
    }, | |||
    "description": { | |||
      "label": "Description", | |||
      "description": "Optional body paragraph below the subtitle. Supports wikitext.", | |||
      "type": "content", | |||
      "required": false | |||
    }, | |||
    "category": { | |||
      "label": "Category", | |||
      "description": "Category name for the live count badge (e.g. Projects/Audio).", | |||
      "type": "string", | |||
      "required": false | |||
    }, | |||
    "count_label": { | |||
      "label": "Count label", | |||
      "description": "Label shown above the count badge.", | |||
      "type": "string", | |||
      "default": "Projects", | |||
      "required": false | |||
    }, | |||
    "submit_form": { | |||
      "label": "Submit form", | |||
      "description": "PageForms form name for the orange Submit button (e.g. Submit_Project or Submit_Tutorial).", | |||
      "type": "string", | |||
      "suggestedvalues": ["Submit_Project", "Submit_Tutorial"], | |||
      "required": false | |||
    }, | |||
    "hub_path": { | |||
      "label": "Hub path", | |||
      "description": "Path used for the Full Index toolbar button. Defaults to the current page name.", | |||
      "type": "wiki-page-name", | |||
      "required": false | |||
    }, | |||
    "hub_type": { | |||
      "label": "Hub type", | |||
      "description": "Template name linked in the Templates toolbar button.", | |||
      "type": "string", | |||
      "default": "Project", | |||
      "suggestedvalues": ["ProjectCard", "TutorialCard"], | |||
      "required": false | |||
    }, | |||
    "license": { | |||
      "label": "Default license", | |||
      "description": "Default license shown in the metadata bar.", | |||
      "type": "string", | |||
      "default": "CC-BY-SA 4.0", | |||
      "required": false | |||
    } | |||
  }, | |||
  "format": "block" | |||
} | |||
</templatedata> | |||
[[Category:Layout Templates]] | [[Category:Layout Templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 08:27, 23 March 2026
HubHeader
Displays the full header block for project and tutorial hub pages. Includes a title/subtitle/description area, optional live count badge, toolbar row with a Submit button and navigation links, and a metadata bar showing default license and live activity (populated by MediaWiki:Gadget-projects.js or MediaWiki:Gadget-tutorials.js).
Usage — Projects hub
{{HubHeader
| title = Audio Projects
| subtitle = Music, sound design, and anything audio
| description = Any openly licensed audio project — sound FX, music, field recordings, podcasts, etc.
| category = Projects/Audio
| count_label = Audio Projects
| submit_form = Submit_Project
| hub_path = Projects/Audio
| hub_type = ProjectCard
| license = CC-BY-SA 4.0
}}
Usage — Tutorials hub
{{HubHeader
| title = Community Tutorials
| subtitle = Step-by-step guides written by the community
| description = Browse tutorials by topic below.
| category = Tutorials
| count_label = Tutorials
| submit_form = Submit_Tutorial
| hub_path = Tutorials
| hub_type = TutorialCard
| license = CC-BY-SA 4.0
}}
Parameters
title- Main heading. Defaults to "Title Text".
subtitle- Orange uppercase subtitle. Defaults to "Subtitle Text".
description- Optional body paragraph below the subtitle.
category- If provided, shows a live count badge using
PAGESINCATEGORY(e.g.Projects/Audio). count_label- Label above the count badge. Defaults to "Projects".
submit_form- If provided, adds an orange "+ Submit" button linking to
Special:FormStart/FormName. hub_path- Path for the "Full Index" button. Defaults to current page name.
hub_type- Template name for the "Templates" toolbar button. Defaults to "Project".
license- Default license shown in the metadata bar. Defaults to "CC-BY-SA 4.0".
Notes
- "Last Submission" and "Activity" in the metadata bar are populated by JavaScript gadgets.
- The toolbar links to Project:Submission Guidelines, Project:Licenses, the page's talk page, and Project:Community — create these pages to avoid red links.
Displays the full header block for a project or tutorial hub page, including title, count badge, toolbar, and a live metadata bar.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | title | Main heading for the hub page.
| String | optional |
| Subtitle | subtitle | Orange uppercase subtitle shown below the title.
| String | optional |
| Description | description | Optional body paragraph below the subtitle. Supports wikitext. | Content | optional |
| Category | category | Category name for the live count badge (e.g. Projects/Audio). | String | optional |
| Count label | count_label | Label shown above the count badge.
| String | optional |
| Submit form | submit_form | PageForms form name for the orange Submit button (e.g. Submit_Project or Submit_Tutorial).
| String | optional |
| Hub path | hub_path | Path used for the Full Index toolbar button. Defaults to the current page name. | Page name | optional |
| Hub type | hub_type | Template name linked in the Templates toolbar button.
| String | optional |
| Default license | license | Default license shown in the metadata bar.
| String | optional |