Template:Rolecat

From Irony Wiki
Jump to navigation Jump to search

{{{1}}} [[Category:]]

Documentation

This template is the same as {{Role}} but it will also automatically add the page to a category. This is meant for marginally simplifying the creation of role templates.

Parameters[edit source]

{{rolecat|name|category|color|dark-background=yes|nocat=yes}}

  • name - The name of the role. This will be the text that will appear in the template. This parameter is required.
  • category - The name of the category that the transcluding page will be added to. Do not include "Category:". This parameter is required; if you don't need it, just use the regular {{Role}} template.
  • color - The color of the role. Can be a hex code (you must include the #) or any other valid CSS color value. If not specified, defaults to #b9bbbe (the default Discord role color).
  • dark-background= - Set this to "yes" to change the background color of the template to the dark color used on Discord profiles. Otherwise, the background will remain white (or whatever color the surrounding background is).
  • nocat= - Set this to "yes" to not add the page to the category. You should use this on the template page, enclosed with <noinclude></noinclude>, so that the template itself isn't added to the category.

Examples[edit source]

Example usage of this template to create another template: {{rolecat|Trollsome|Trollsome users|#9062f8|dark-background={{{dark-background|}}}|nocat={{{nocat|<noinclude>yes</noinclude>}}}}} This will output Trollsome , as well as add the category Category:Trollsome users, but only on other pages.

Example usage of this template directly on a page: {{rolecat|Trollsome|Trollsome users|#9062f8}} This will output Trollsome , as well as add the category Category:Trollsome users.

TemplateData[edit source]

Same as {{Role}}, but also adds the page to a category.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Role name1

The name of the role. This will be the text that will appear.

Example
Was it worth it?
Stringrequired
Category2

The name of the category that the page will be added to. Do not include "Category:".

Example
Trollsome users
Stringrequired
Color3

The color of the role. Can be a hex code (you must include the #, e.g. #ff7f00) or any other valid CSS color value.

Default
#b9bbbe
Stringsuggested
Dark backgrounddark-background

Set this to "yes" to change the background color of the template to the dark color used on Discord profiles.

Example
yes
Stringoptional
nocatnocat

Set this to "yes" to not add the page to the category. You should use this on the template page, enclosed with <noinclude></noinclude>, so that the template itself isn't added to the category.

Example
{{{nocat|<noinclude>yes</noinclude>}}}
Booleanoptional