Template:Background/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<noinclude>{{doc|0}}</noinclude>__NOTOC__
{{Doc/subpage}}__NOTOC__
 
This template allows you to add a background for an article.
This template allows you to add a background for an article.


==Usage==
== Parameters and Examples ==
Just insert {{Code|style=1|select=1|<nowiki>{{background|}}</nowiki>}} into the page and insert your image after {{Code|style=1|<nowiki>background|</nowiki>}} or {{Code|style=1|<nowiki>modifier|</nowiki>}}.
{| class="standard-table" width="100%"
 
! width="15%" | Name
 
! width="30%" | Description
====Using Modifiers====
! Example
Insert {{Code|style=1|select=1|<nowiki>modifier=|</nowiki>}} after {{Code|style=1|select=1|<nowiki>background|</nowiki>}} and replace '''"modifier"''' with the name of an existing modifier. After the equal sign, you need to write the properties corresponding to the modifier.
! width="13%" | Preview
 
|-
==Modifiers==
| align="center" | {{Code|{{Param|file}}}}
{| class=standard-table
| The path to the image.
! Name !! Description
| {{CodeBlock|<nowiki>{{Background
| file = Hlalyx1.jpg
}}</nowiki>}}
| align="center" | Preview is not possible
|-
|-
| {{Code|select=1|background=|opacity}} || allows you to change the opacity of the entire block (default {{Code|style=1|select=1|0.05}})
| align="center" | {{Code|{{Param|opacity}}}}
| Allows you to change the opacity of the entire block.
({{Code|style=1|select=1|0.05}} by default)
| {{CodeBlock|<nowiki>{{Background|opacity=0.5}}</nowiki>}}
| align="center" | Preview is not possible
|-
|-
| {{Code|select=1|background=|background-color}} || controls the background color of the block (default {{Code|style=1|select=1|transparent}})
| align="center" | {{Code|{{Param|bgcolor}}}}
| Controls the background color of the block.
({{Code|style=1|select=1|transparent}} by default)
| {{CodeBlock|<nowiki>{{Background|bgcolor=rgb(255,255,255)}}</nowiki>}}
| align="center" | Preview is not possible
|-
|-
| {{Code|select=1|background=|gradient-color}} || controls the color of the bottom gradient (default {{Code|style=1|select=1|38,38,38}})
| align="center" | {{Code|{{Param|gradient-color}}}}
| Controls the color of the bottom gradient.
({{Code|style=1|select=1|38,38,38}} by default)
| {{CodeBlock|<nowiki>{{Background|gradient-color=50,50,50}}</nowiki>}}
| align="center" | Preview is not possible
|-
|-
| {{Code|select=1|background=|gradient-height}} || controls the height of the gradient (default {{Code|style=1|select=1|150px}})
| align="center" | {{Code|{{Param|gradient-height}}}}
| Controls the height of the gradient.
({{Code|style=1|select=1|150px}} by default)
| {{CodeBlock|<nowiki>{{Background|gradient-height=600px}}</nowiki>}}
| align="center" | Preview is not possible
|-
|-
| align="center" | {{Code|{{Param|mode}}}}
| Controls the position of the background image on the page.
* <code>0</code> &ndash; Absolute ''(default)'': Always at the top of the page.
* <code>1</code> &ndash; Static: The regular position where the template occurs in the wikitext
* <code>2</code> &ndash; Sticky: Like static, but the image follows the user when scrolling about, until the containing block (such as a simple <code>&lt;div&gt;</code>) ends.
| {{CodeBlock|<nowiki>{{Background|mode=1}}</nowiki>}}
| align="center" | Preview is not possible
|}
|}


==Examples==
<includeonly>{{sandbox other||
* [[User:REDESAILE|THE OWL]]
[[Category:Templates]]
* [[User_talk:REDESAILE|User talk: THE OWL]]
}}</includeonly>
* [[Half-Life: Alyx Workshop Tools:ru|Инструменты Мастерской Half-Life: Alyx]]

Latest revision as of 04:48, 24 April 2025

Edit-copy.png
This is a documentation subpage for Template:Background.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template allows you to add a background for an article.

Parameters and Examples

Name Description Example Preview
{{{file}}} The path to the image.
{{Background | file = Hlalyx1.jpg }}
Preview is not possible
{{{opacity}}} Allows you to change the opacity of the entire block.

(0.05 by default)

{{Background|opacity=0.5}}
Preview is not possible
{{{bgcolor}}} Controls the background color of the block.

(transparent by default)

{{Background|bgcolor=rgb(255,255,255)}}
Preview is not possible
{{{gradient-color}}} Controls the color of the bottom gradient.

(38,38,38 by default)

{{Background|gradient-color=50,50,50}}
Preview is not possible
{{{gradient-height}}} Controls the height of the gradient.

(150px by default)

{{Background|gradient-height=600px}}
Preview is not possible
{{{mode}}} Controls the position of the background image on the page.
  • 0 – Absolute (default): Always at the top of the page.
  • 1 – Static: The regular position where the template occurs in the wikitext
  • 2 – Sticky: Like static, but the image follows the user when scrolling about, until the containing block (such as a simple <div>) ends.
{{Background|mode=1}}
Preview is not possible