Template

TemplateStyles

From Dogcraft Wiki

mNo edit summary
mNo edit summary
Line 20: Line 20:
This concept is based on Wikipedia's [[wp:Template:TemplateStyles|<pre><nowiki>{{Uses TemplateStyles}}</nowiki></pre>]] template, but is implemented differently. (Using a combination of the [[Sidebar|<pre><nowiki>{{Sidebar}}</nowiki></pre>]] and [[Notice|<pre><nowiki>{{Notice}}</nowiki></pre>]] templates.)
This concept is based on Wikipedia's [[wp:Template:TemplateStyles|<pre><nowiki>{{Uses TemplateStyles}}</nowiki></pre>]] template, but is implemented differently. (Using a combination of the [[Sidebar|<pre><nowiki>{{Sidebar}}</nowiki></pre>]] and [[Notice|<pre><nowiki>{{Notice}}</nowiki></pre>]] templates.)


==Example(s)==
===Example(s)===
===No parameters===
====No parameters====
''When no parameters are set, the template will use "Template:<nowiki>{{PAGENAME}}</nowiki>/styles.css" as the CSS page shown. (<nowiki>{{PAGENAME}}</nowiki> being the name of the actual template.) This should be enough in most cases.''
''When no parameters are set, the template will use "Template:<nowiki>{{PAGENAME}}</nowiki>/styles.css" as the CSS page shown. (<nowiki>{{PAGENAME}}</nowiki> being the name of the actual template.) This should be enough in most cases.''
{{TemplateStyles}}
{{TemplateStyles}}
Line 28: Line 28:




===Single parameter===
====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.''
''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.''
{{TemplateStyles|TemplateStyles/dark.css}}
{{TemplateStyles|TemplateStyles/dark.css}}
Line 35: Line 35:




===Two parameters===
====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)''
''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)''
{{TemplateStyles||, [[Template:TemplateStyles/dark.css|TemplateStyles/dark.css]] and [[Template:TemplateStyles/dark.css|TemplateStyles/mobile.css]]}}
{{TemplateStyles||, [[Template:TemplateStyles/dark.css|TemplateStyles/dark.css]] and [[Template:TemplateStyles/dark.css|TemplateStyles/mobile.css]]}}
Line 42: Line 42:




==Template data==
===Template data===
<templatedata>
<templatedata>
{
{
Line 65: Line 65:
}
}
</templatedata>
</templatedata>
__NOTOC__
</noinclude>
</noinclude>

Revision as of 01:21, 12 July 2022


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.

  • {{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.

  • {{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)

  • {{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.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
CSS stylesheet1

The full name of the CSS stylesheet this template uses, excluding the "Template:" namespace name at the start. This parameter is optional.

Example
Pagetabs/styles.css
Page namesuggested
Further CSS Stylesheets2

Completely free-form parameter for specifying further CSS stylesheets for templates using more then one.

Example
, [[Template:Pagetabs/dark.css]] and [[Template:Pagetabs/mobile.css]]
Stringsuggested


This page was last modified on 12 July 2022, at 01:21. (10 months ago)