Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
You must create an account or log in to edit.

Template:Hatnote: Difference between revisions

Template page
Content deleted Content added
No edit summary
Tag: 2017 source edit
No edit summary
Tag: 2017 source edit
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#invoke:Hatnote|main}}</includeonly><!--
<includeonly><div class="template-type-hatnote noexcerpt" {{#if:{{{color|}}}|style="--color-amaranth-legacy-scope:{{{color}}}{{yesno|{{yesno-yes|{{{color_applies_to_links|}}}}}|yes=;--color-link:{{{color}}}|no=}}"|}}>
--><noinclude>
{{yesno|{{yesno-no|{{{remove_hr|{{{remove_hr_top|}}}}}}}}|no=<hr/>|yes=}}
<templatedata>
<div class="hatnote">
{{#if:{{{file|}}}|<div>[[File:{{{file}}}|{{{file_size|80px}}}|class=notpageimage|link=|alt=]]</div>|}}
<div><span style="{{#if:{{{primary_gradient|}}}|color:transparent;background-image:linear-gradient({{{primary_gradient}}});-webkit-background-clip:text;background-clip:text|color:var(--color-amaranth-legacy-scope)}};font-size:var(--font-size-xx-large);font-family:{{{font|var(--font-family-serif)}}}">{{{primary}}}</span><br/><!--
-->{{yesno|{{yesno-yes|{{{italic_secondary|}}}}}|yes=''{{{secondary}}}''|no={{{secondary}}}}}</div>
</div>
{{yesno|{{yesno-no|{{{remove_hr|{{{remove_hr_bottom|}}}}}}}}|no=<hr/>|yes=}}
</div>
<templatestyles src="Hatnote/styles.css"/></includeonly><!--
--><noinclude><templatedata>
{
{
"params": {
"params": {
"file": {
"file2": {
"label": "File",
"label": "Right image",
"description": "The file to put on the left as a thumbnail",
"description": "The file to put on the right as a thumbnail (80px or custom size)",
"example": "Glypht.png",
"type": "wiki-file-name",
"type": "wiki-file-name",
"default": "Unknown.png",
"example": "Glypht.png"
"suggested": true
},
},
"file_size": {
"file_size": {
"label": "File size",
"label": "File size",
"description": "The file's thumbnail size",
"description": "The size of the images (only works with two images)",
"example": "120px",
"example": "120px",
"type": "string",
"type": "string",
Line 35: Line 25:
},
},
"primary_gradient": {
"primary_gradient": {
"label": "Primary gradient",
"label": "Primary text gradient",
"description": "The CSS linear-gradient of the primary text",
"description": "The CSS linear-gradient of the primary text",
"example": "to bottom, #ffffff, #36454f",
"example": "to bottom, #ffffff, #36454f",
Line 41: Line 31:
},
},
"font": {
"font": {
"label": "Font",
"label": "Primary text font",
"description": "The font to use for text inside the header",
"description": "The font to use for the primary text",
"example": "Varela Round",
"example": "Varela Round",
"type": "string",
"type": "string",
Line 58: Line 48:
"type": "string",
"type": "string",
"required": true
"required": true
},
"italic_secondary": {
"label": "Italic secondary text",
"description": "If the secondary text should be italicized",
"type": "boolean",
"default": "true"
},
},
"remove_hr": {
"remove_hr": {
Line 76: Line 72:
"type": "boolean",
"type": "boolean",
"default": "false"
"default": "false"
},
"italic_secondary": {
"label": "Italic secondary text",
"description": "If the secondary text should be italicized",
"type": "boolean",
"default": "true"
},
},
"color_applies_to_links": {
"color_applies_to_links": {
Line 89: Line 79:
"type": "boolean",
"type": "boolean",
"default": "true"
"default": "true"
},
"file1": {
"label": "Left image",
"description": "The file to put on the left as a thumbnail (80px or custom size)",
"example": "Glypht.png",
"type": "wiki-file-name",
"suggested": true
},
"primary_font_size": {
"label": "Primary text font size",
"description": "The size of the primary text",
"example": "x-large",
"type": "string",
"default": "xxx-large"
}
}
},
},
"description": "Adds a left-aligned hatnote with one optional image on the left side",
"description": "Adds a hatnote with either no images, one image on the left, or two images on the left and right",
"format": "block",
"format": "block",
"paramOrder": [
"paramOrder": [
"file",
"file1",
"file2",
"file_size",
"file_size",
"color",
"color",
"color_applies_to_links",
"color_applies_to_links",
"primary_gradient",
"primary_gradient",
"font",
"primary",
"primary",
"font",
"primary_font_size",
"secondary",
"secondary",
"italic_secondary",
"remove_hr",
"remove_hr",
"remove_hr_top",
"remove_hr_top",
"remove_hr_bottom",
"remove_hr_bottom"
"italic_secondary"
]
]
}
}
</templatedata>
</templatedata>


== Examples ==
==Examples==
<pre>{{Hatnote
<pre>{{Hatnote
|file=Glypht.png
|file=Glypht.png
|color=#ababab
|color=#ababab
|primary_gradient=to right, #ababab, #ffffff
|primary=Glypht Glypht glypht
|primary=Glypht Glypht glypht
|secondary=[[Main Page|Amarant]]
|secondary=[[Main Page|Amarant]]
|italic_secondary=yes
|remove_hr_top=true
}}</pre>
}}</pre>
{{Hatnote
{{Hatnote
|file=Glypht.png
|file=Glypht.png
|color=#ababab
|color=#ababab
|primary_gradient=to right, #ababab, #ffffff
|primary=Glypht Glypht glypht
|primary=Glypht Glypht glypht
|secondary=[[Main Page|Amarant]]
|secondary=[[Main Page|Amarant]]
|italic_secondary=yes
|remove_hr_top=true
}}
}}


Line 137: Line 145:
}}
}}


<pre>{{Hatnote
== See also ==
|file1=Glypht.png
* [[Template:Hatnote2]]
|file2=Cosmoria Symbol.png
|color=#cdcdcd
|primary=Glypht Glypht glypht
|secondary=[[Main Page|Amarant]]
}}</pre>
{{Hatnote
|file1=Glypht.png
|file2=Cosmoria Symbol.png
|color=#cdcdcd
|primary=Glypht Glypht glypht
|secondary=[[Main Page|Amarant]]
}}
</noinclude>
</noinclude>

Latest revision as of 16:44, July 2, 2025

Adds a hatnote with either no images, one image on the left, or two images on the left and right

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Left imagefile1

The file to put on the left as a thumbnail (80px or custom size)

Example
Glypht.png
Filesuggested
Right imagefile2

The file to put on the right as a thumbnail (80px or custom size)

Example
Glypht.png
Fileoptional
File sizefile_size

The size of the images (only works with two images)

Default
80px
Example
120px
Stringoptional
Colorcolor

The color of the horizontal rules, the primary text, and links inside the header

Example
#ababab
Stringsuggested
Color applies to linkscolor_applies_to_links

If the color specified should apply to links as well

Default
true
Example
false
Booleanoptional
Primary text gradientprimary_gradient

The CSS linear-gradient of the primary text

Example
to bottom, #ffffff, #36454f
Stringoptional
Primary textprimary

The text displayed at the top (on the first line)

Stringrequired
Primary text fontfont

The font to use for the primary text

Default
Cinzel
Example
Varela Round
Stringoptional
Primary text font sizeprimary_font_size

The size of the primary text

Default
xxx-large
Example
x-large
Stringoptional
Secondary textsecondary

The text displayed at the bottom (on the second line)

Stringrequired
Italic secondary textitalic_secondary

If the secondary text should be italicized

Default
true
Booleanoptional
Remove linesremove_hr

If the lines at the top and bottom should be removed

Default
false
Booleanoptional
Remove top lineremove_hr_top

If the line at the top should be removed

Default
false
Booleanoptional
Remove bottom lineremove_hr_bottom

If the line at the bottom should be removed

Default
false
Booleanoptional

Examples

{{Hatnote
|file=Glypht.png
|color=#ababab
|primary_gradient=to right, #ababab, #ffffff
|primary=Glypht Glypht glypht
|secondary=[[Main Page|Amarant]]
|italic_secondary=yes
}}

Glypht Glypht glypht
Amarant

{{Hatnote
|color=red
|primary=Glypht Glypht glypht
|secondary=[[Main Page|Amarant]]
}}

Glypht Glypht glypht
Amarant

{{Hatnote
|file1=Glypht.png
|file2=Cosmoria Symbol.png
|color=#cdcdcd
|primary=Glypht Glypht glypht
|secondary=[[Main Page|Amarant]]
}}

Glypht Glypht glypht
Amarant

Contents