Template:Headline

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Headline/doc.

This template formats text in a style somewhat similar to a section heading (but not defining a separately editable section, and also not in a serif font as with normal section headings). It is intended mainly to provide “welcome” messages on pages such as Commons:Village pump. When given empty or non-visible text (see examples below), only a horizontal rule (possibly colored) is shown.

Usage

{{Headline |1= |2= }}

Colors can be specified with three or six hexadecimal digits. Be careful to avoid colors that make the text hard to read.

Template parameters

<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

This template formats text in a style somewhat similar to a section heading (but not defining a separately editable section, and also not in a serif font as with normal section headings). It is intended mainly to provide “welcome” messages on pages such as Commons:Village pump. When given empty or non-visible text, only a horizontal rule (possibly colored) is shown.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
text1

The text of the headline, can be empty

Contentsuggested
color2

The color of the underline; defaults to text color

Linesuggested
backgroundbackground

Style (usually color) of the background

Default
transparent
Lineoptional
text colorcolor

Color of the text

Default
#000
Lineoptional
font familyfont-family

Font family of the text, can be a comma-separated list

Default
sans-serif
Lineoptional
font sizefont-size

Size of the font, avoid setting size in “px”

Default
120%
Lineoptional
additional stylestyle

Additional CSS style settings (it can even override the settings provided by the parameters listed above)

Lineoptional

Additional information

The template is intended to be used in the following namespaces: the Commons namespace

The template is intended to be used by the following user groups: all users

See also

Localization

This template is not intended to be localized.

Examples

  • {{Headline|Using defaults}} results in:
    Using defaults

  • {{Headline|Colored underline|#a00}} results in:
    Colored underline

  • {{Headline|Colored text and underline|color=#802000}} results in:
    Colored text and underline

  • {{Headline|Colored background|background=#09c|color=#fff}} results in:
    Colored background

  • {{Headline|Additional style|style=font-weight:bold}} results in:
    Additional style

  • {{Headline||#a00}} (no text) results in:

  • {{Headline| |#a00}} (space character for text) results in:

  • {{Headline|&nbsp;|#a00}} (non-breaking space for text) results in: