Template
TemplateStyles
From Dogcraft Wiki
mNo edit summary |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
|title=This template uses TemplateStyles | |title=This template uses TemplateStyles | ||
|message=<br /> | |message=<br /> | ||
* [[{{NAMESPACE}}:{{{1|{{ROOTPAGENAME}}/styles.css}}}]]{{#if:{{{2|}}}|{{{2}}}}} | * {{#if:{{{freeform|}}}|{{{freeform}}}|[[{{NAMESPACE}}:{{{1|{{ROOTPAGENAME}}/styles.css}}}]]{{#if:{{{2|}}}|{{{2}}}}}}} | ||
}} | }} | ||
|contentstyle=padding:0; | |contentstyle=padding:0; | ||
Line 64: | Line 64: | ||
"description": "Used to show that a template uses TemplateStyles, and link the CSS page(s) used." | "description": "Used to show that a template uses TemplateStyles, and link the CSS page(s) used." | ||
} | } | ||
</templatedata> | </templatedata>[[Category:Documentation templates]] | ||
__NOTOC__ | __NOTOC__ | ||
</noinclude> | </noinclude> |
Latest revision as of 13:27, 4 December 2023
TemplateStyles notice
This template is used to show that templates use TemplateStyles. It is meant to be placed at the top of the template's documentation and show which CSS styelsheet page(s) it uses. It and automatically adds the template to Category:Templates using TemplateStyles.
This concept is based on Wikipedia's {{Uses TemplateStyles}} template, but is implemented differently. (Using a combination of the {{Sidebar}} and {{Notice}} templates.)
Example(s)
No parameters
When no parameters are set, the template will use "Template:{{PAGENAME}}/styles.css" as the CSS page shown. ({{PAGENAME}} being the name of the actual template.) This should be enough in most cases.
This template uses TemplateStyles: |
{{TemplateStyles}}
generates:
Single parameter
The name of the CSS page to show can be set using the template's first (unnamed) parameter. This is useful if the stylesheet page is not called "styles.css". The whole title must be set except for the "Template:" namespace name.
This template uses TemplateStyles: |
{{TemplateStyles|TemplateStyles/dark.css}}
generates:
Two parameters
A second parameter is available to set any further stylesheets in the case of templates using more then one. This parameter is completely free-form, requiring entering everything manually including the link itself and commas. (An example can be seen bellow)
This template uses TemplateStyles:
|
{{TemplateStyles|TemplateStyles/styles.css|, [[Template:TemplateStyles/dark.css|TemplateStyles/dark.css]] and [[Template:TemplateStyles/dark.css|TemplateStyles/mobile.css]]}}
generates:
Template data
Used to show that a template uses TemplateStyles, and link the CSS page(s) used.
Parameter | Description | Type | Status | |
---|---|---|---|---|
CSS stylesheet | 1 | The full name of the CSS stylesheet this template uses, excluding the "Template:" namespace name at the start. This parameter is optional.
| Page name | suggested |
Further CSS Stylesheets | 2 | Completely free-form parameter for specifying further CSS stylesheets for templates using more then one.
| String | suggested |