Template:Notify/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See also: Unicodifying, replaced: See Also → See also)
 
(16 intermediate revisions by 6 users not shown)
Line 5: Line 5:
{{CodeBlock|<nowiki>{{Notify
{{CodeBlock|<nowiki>{{Notify
| mode = inline
| mode = inline
| size = 10px
| img =  
| img =  
| text =  
| text =  
Line 10: Line 11:
}}</nowiki>}}
}}</nowiki>}}


== Parameters and Example ==
== Parameters and Examples ==
=== Shared ===
=== Shared ===
{| class="standard-table" width="100%"
{| class="standard-table" width="100%"
Line 20: Line 21:
| align="center" | {{Code|style=2|{{Param|1}}}} or {{Code|style=2| {{Param|text}} }}
| align="center" | {{Code|style=2|{{Param|1}}}} or {{Code|style=2| {{Param|text}} }}
| style="padding:8px" | Your text.
| style="padding:8px" | Your text.
{{ModernImportant| Do not use {{Param|text}} in other templates that are based on this template. The named parameter breaks the lists. }}
| {{CodeBlock|margin=5px|<nowiki>| Hello, World!</nowiki>}} {{CodeBlock|margin = 5px|<nowiki>| text = Hello, World!</nowiki>}}
| {{CodeBlock|margin=5px|<nowiki>| Hello, World!</nowiki>}} {{CodeBlock|margin = 5px|<nowiki>| text = Hello, World!</nowiki>}}
| style="padding:10px" | {{Notify|Hello, World!}} {{Notify|text = Hello, World!}}
| style="padding:10px" | {{Notify|Hello, World!}} {{Notify|text = Hello, World!}}
Line 39: Line 42:
| style="padding:8px" | Notification icon.
| style="padding:8px" | Notification icon.
| {{CodeBlock|margin = 5px|<nowiki>| img = Note.png</nowiki>}}
| {{CodeBlock|margin = 5px|<nowiki>| img = Note.png</nowiki>}}
| style="padding:8px" | {{Notify|mode = inline|img = Important template.png|text = Hello, World!}}
| style="padding:8px" | {{Notify|mode = inline|size=10px|img = Important template.png|text = Hello, World!}}
|-
| align="center" | {{Code|style=2| {{Param|size}} }}
| style="padding:8px" | Notification icon size (Highly recommended to specify since most icons support high DPI.)
| {{CodeBlock|margin = 5px|<nowiki>| size = 16px </nowiki>}}
| style="padding:8px" | {{Notify|mode = inline|img = Important template.png|size = 16px|type = Important|text = Hello, World!}}
|-
|-
| align="center" | {{Code|style=2| {{Param|type}} }}
| align="center" | {{Code|style=2| {{Param|type}} }}
| style="padding:8px" | Notification type.
| style="padding:8px" | Notification type.
| {{CodeBlock|margin = 5px|<nowiki>| type = Warning</nowiki>}}
| {{CodeBlock|margin = 5px|<nowiki>| type = Warning</nowiki>}}
| style="padding:8px" | {{Notify|mode = inline|img = Important template.png|type = Important|text = Hello, World!}}
| style="padding:8px" | {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!}}
|-
|-
| align="center" | {{Code|style=2| {{Param|color}} }}
| align="center" | {{Code|style=2| {{Param|color}} }}
| style="padding:8px" | Notification color (RGB only).
| style="padding:8px" | Notification color (RGB only).<br> RGBA may also work.
| {{CodeBlock|margin = 5px|<nowiki>| color = 240,211,0</nowiki>}}
| {{CodeBlock|margin = 5px|<nowiki>| color = 240,211,0</nowiki>}}
| style="padding:8px" | {{Notify|mode = inline|img = Important template.png|type = Important|text = Hello, World!|color = 240,211,0}}
| style="padding:8px" | {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!|color = 240,211,0}}
|}
|}
==== Offset ====
#{{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!}}
#{{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!|offset=0}}
#{{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!|offset=1}}
#{{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!|offset=2}}
#{{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!|offset=3}}
#{{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!|offset=9}}
#{{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!|offset=10}}
=== Custom styles ===
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | root_inline_style = background-color: red !important;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | root_inline_style = margin-left: 2rem !important;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | root_inline_style = margin-left: 4rem !important;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | type style = padding-left: 2rem;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | type style = padding-left: 4rem;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | type style = margin-left: 2rem;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | type style = margin-left: 4rem;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World!}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | text style = margin-left: 2rem;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | text style = margin-left: 4rem;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | root_inline_style = padding-left: 2rem !important;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | root_inline_style = padding-left: 4rem !important;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | root_inline_style = margin-left: 2rem;}}
# {{Notify|mode = inline|size=10px|img = Important template.png|type = Important|text = Hello, World! | root_inline_style = margin-left: 4rem;}}


== Special Subpages ==
== Special Subpages ==
* {{Code|[[/inline/doc]]}} - Documentation for inline note templates.
* {{Code|[[/inline/doc]]}} - Documentation for inline note templates.


== See Also ==
== See also ==
* [[:Category:Modern Templates]]
* [[:Category:Modern Templates]]
* [[:Category:Inline note templates]]
* [[:Category:Inline note templates]]

Latest revision as of 06:55, 7 January 2024

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

Different types of notifications in one template. Created as a basis for other templates.

Copy and Paste

{{Notify | mode = inline | size = 10px | img = | text = | color = }}

Parameters and Examples

Shared

Parameter Description Example Preview
{{{1}}} or {{{text}}} Your text.
Icon-Important.pngImportant: Do not use {{{text}}} in other templates that are based on this template. The named parameter breaks the lists.
| Hello, World!
| text = Hello, World!
Hello, World!
Hello, World!
{{{mode}}} Switches the template modes. Avaliable modes: inline.
| mode = inline
Hello, World!

Inline mode

Parameter Description Example Preview
{{{img}}} Notification icon.
| img = Note.png
Hello, World!
{{{size}}} Notification icon size (Highly recommended to specify since most icons support high DPI.)
| size = 16px
Important template.pngImportant:Hello, World!
{{{type}}} Notification type.
| type = Warning
Important template.pngImportant:Hello, World!
{{{color}}} Notification color (RGB only).
RGBA may also work.
| color = 240,211,0
Important template.pngImportant:Hello, World!

Offset

  1. Important template.pngImportant:Hello, World!
  2. Important template.pngImportant:Hello, World!
  3. Important template.pngImportant:Hello, World!
  4. Important template.pngImportant:Hello, World!
  5. Important template.pngImportant:Hello, World!
  6. Important template.pngImportant:Hello, World!
  7. Important template.pngImportant:Hello, World!

Custom styles

  1. Important template.pngImportant:Hello, World!
  2. Important template.pngImportant:Hello, World!
  3. Important template.pngImportant:Hello, World!
  4. Important template.pngImportant:Hello, World!
  5. Important template.pngImportant:Hello, World!
  6. Important template.pngImportant:Hello, World!
  7. Important template.pngImportant:Hello, World!
  8. Important template.pngImportant:Hello, World!
  9. Important template.pngImportant:Hello, World!
  10. Important template.pngImportant:Hello, World!
  11. Important template.pngImportant:Hello, World!
  12. Important template.pngImportant:Hello, World!
  13. Important template.pngImportant:Hello, World!
  14. Important template.pngImportant:Hello, World!
  15. Important template.pngImportant:Hello, World!
  16. Important template.pngImportant:Hello, World!

Special Subpages

See also