Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (tweak)
m (+samples explained + tweak)
Line 15: Line 15:


|-
|-
| colspan="2" style="font-size:large; text-align:center; background:#6bbe45; color:white" | '''{{{component}}}'''<span style="font-size:small;"><br>[[:Category:{{{type|activity}}}|({{{type|activity}}})]]</span>
| colspan="2" style="font-size:large; text-align:center; background:#6bbe45; color:white" | '''{{{component|{{PAGENAME}}}}}'''<span style="font-size:small;"><br>[[:Category:{{{type|activity}}}|({{{type|activity}}})]]</span>
{{ #if: {{{icon|}}} | {{!}}-
{{ #if: {{{icon|}}} | {{!}}-
{{!}} colspan="2" style="valign:middle; padding:5px"{{!}} [[Image:{{{icon}}}{{!}}center]] |}}
{{!}} colspan="2" style="valign:middle; padding:5px"{{!}} [[Image:{{{icon}}}{{!}}center]] |}}
Line 52: Line 52:
<!-- CATEGORIZATION -- TESTING -->
<!-- CATEGORIZATION -- TESTING -->
Testing parameterized categorizations:
Testing parameterized categorizations:
<!-- CATEGORIZATION -- type -->
<!-- CATEGORIZATION -- type -->
type => {{{type}}} | {{lc:{{{type}}}}}
Category:{{ #switch: {{{type}}} | activity=Activity | core=Core | #default=Unknown Component }}
Category:{{ #switch: {{lc:{{{type}}}}} | activity=Activity | core=Core | #default=Unknown Component }}
<!-- CATEGORIZATION -- l10n -->
<!-- CATEGORIZATION -- l10n -->
Category:{{ #if: {{{l10n|}}} | l10n | Pending i18n }}
Category:{{ #if: {{{l10n|}}} | l10n | Pending i18n }}
Line 81: Line 83:
<br clear="all">
<br clear="all">
{{ Sandbox | component = Foo | type = Bar | icon = Xo s.png | testplan = [[some page]] }}
{{ Sandbox | component = Foo | type = Bar | icon = Xo s.png | testplan = [[some page]] }}

<nowiki>{{</nowiki> Sandbox
<nowiki>{{</nowiki> Sandbox
| component = Foo
| component = Foo
Line 88: Line 90:
| testplan = <nowiki>[[some page]]</nowiki>
| testplan = <nowiki>[[some page]]</nowiki>
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>
; Notes : the ''type'' is not recognized, so defaults to a general one, ''testplan'' shows because it has one specified, ''icon'' shows, goes into ''pending 18n'' as no ''l10n'' resource is given.

<br clear="all">
{{ Sandbox | type = Activity | l10n = [[Localization]] }}
<nowiki>{{</nowiki> Sandbox
| type = activity
| l10n = <nowiki>[[Localization]]</nowiki>
<nowiki>}}</nowiki>
; Notes : Taking the ''component'' name from the <nowiki>{{PAGENAME}}</nowiki>, ''icon'' is undefined. Goes into the l10n category, as it can be l10n'ed.


[[Category:Template]]
[[Category:Template]]

Revision as of 16:57, 30 June 2007

Many times you may want to just 'test' an idea for a template, I haven't found a sensible way of fully testing templates by themselves (as they will not get included in the edited version, but rather the saved version).

The idea of this Template:Sandbox is to have that, a simple testing zone that will not interfere with others and avoid leaving a trail of botched attempts.

Please leave this comment/text for others to read.
See Also http://meta.wikimedia.org/wiki/Help:Template
Testing: Status box


Sandbox
(activity)
Status: {{{status}}}
Version: {{{version}}}
Base: {{{base}}}
Source: {{{source}}}
Language: {{{language}}}
l10n: add it here
Contributors
{{{contributors}}}
Testing parameterized categorizations:

 type => {{{type}}} | {{{type}}}
 Category:Unknown Component
 Category:Pending i18n


This template automatically includes the page in the [[:Category:{{{type}}}]].

Usage

{{Status box
 | component    = <!-- Name of the component -->
 | type         = <!-- Type of the component {activity, core, support} -->
 | icon         = <!-- file name.ext (sans [[Image:file name.ext]] -->
 | status       = <!-- Status of the activity -->
 | version      = <!-- Current/latest version available -->
 | base         = <!-- Yes/No if it's included in the OS images
                       / Could be the first build number -->
 | source       = <!-- Repository / location of the source -->
 | language     = <!-- OPTIONAL -- Computer language of the source -->
 | l10n         = <!-- Repository / location of the l10n resources -->
 | testplan     = <!-- OPTIONAL -- link to the test plan page -->
 | contributors = <!-- People contributing to the activity -->
 }}

Sample



Foo
(Bar)
Xo s.png
Status: {{{status}}}
Version: {{{version}}}
Base: {{{base}}}
Source: {{{source}}}
Language: {{{language}}}
l10n: add it here
Test plans: some page
Contributors
{{{contributors}}}
Testing parameterized categorizations:

 type => Bar | bar
 Category:Unknown Component
 Category:Pending i18n

{{ Sandbox
| component = Foo
| type = Bar
| icon = Xo s.png
| testplan = [[some page]]
}}
Notes
the type is not recognized, so defaults to a general one, testplan shows because it has one specified, icon shows, goes into pending 18n as no l10n resource is given.



Sandbox
(Activity)
Status: {{{status}}}
Version: {{{version}}}
Base: {{{base}}}
Source: {{{source}}}
Language: {{{language}}}
l10n: Localization
Contributors
{{{contributors}}}
Testing parameterized categorizations:

 type => Activity | activity
 Category:Activity
 Category:l10n

{{ Sandbox
| type = activity
| l10n = [[Localization]]
}}
Notes
Taking the component name from the {{PAGENAME}}, icon is undefined. Goes into the l10n category, as it can be l10n'ed.