Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (bug in switch)
m (tweak & doc)
Line 36: Line 36:
| ''page'' = <!-- OPTIONAL — the page name (sans enclosing ''[[]]'') to include or redirect to -->
| ''page'' = <!-- OPTIONAL — the page name (sans enclosing ''[[]]'') to include or redirect to -->
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>

'''NOTE:''' If you '''name''' one of the parameters, the other also has to be named.


== Sample ==
== Sample ==


The following are all equivalents, as they all generate a <tt>REDIRECT</tt> directive to the upper level
The following are all equivalents, as they all generate a <tt>REDIRECT</tt> directive to the upper level
<nowiki>{{</nowiki>Missing translation|es<nowiki>}}</nowiki>
<nowiki>{{Missing translation|es}}</nowiki>
<nowiki>{{</nowiki>Missing translation|lang=es<nowiki>}}</nowiki>
<nowiki>{{Missing translation|es|redirect}}</nowiki>
<nowiki>{{</nowiki>Missing translation|lang=es|redirect<nowiki>}}</nowiki>
<nowiki>{{Missing translation|lang=es}}</nowiki>
<nowiki>{{</nowiki>Missing translation|lang=es|action=redirect<nowiki>}}</nowiki>
<s><nowiki>{{Missing translation|lang=es|redirect}}</nowiki></s> # Doesn't work due to naming inconsistency
<nowiki>{{</nowiki>Missing translation|lang=es|action=redirect|page=Foo<nowiki>}}</nowiki> # assuming the including page is <tt><nowiki>[[Foo/subpage]]</nowiki></tt>
<nowiki>{{Missing translation|lang=es|action=redirect}}</nowiki>
<nowiki>{{Missing translation|lang=es|action=redirect|page=Foo}}</nowiki> # assuming the including page is <tt><nowiki>[[Foo/subpage]]</nowiki></tt>


If instead of <tt>REDIRECT</tt>ing you want to include the ''parent'' page, the following are equivalent:
If instead of <tt>REDIRECT</tt>ing you want to include the ''parent'' page, the following are equivalent:
<nowiki>{{</nowiki>Missing translation|es|include<nowiki>}}</nowiki>
<nowiki>{{Missing translation|es|include}}</nowiki>
<nowiki>{{</nowiki>Missing translation|lang=es|include<nowiki>}}</nowiki>
<s><nowiki>{{Missing translation|lang=es|include}}</nowiki></s> # Doesn't work due to naming inconsistency
<nowiki>{{</nowiki>Missing translation|lang=es|action=include<nowiki>}}</nowiki>
<nowiki>{{Missing translation|lang=es|action=include}}</nowiki>
<nowiki>{{</nowiki>Missing translation|lang=es|action=include|page=Foo<nowiki>}}</nowiki> # assuming the including page is <tt><nowiki>[[Foo/subpage]]</nowiki></tt>
<nowiki>{{Missing translation|lang=es|action=include|page=Foo}}</nowiki> # assuming the including page is <tt><nowiki>[[Foo/subpage]]</nowiki></tt>
# This would include the <tt><nowiki>[[Bar]]</nowiki></tt> page regardless of what the including page is.
# This would include the <tt><nowiki>[[Bar]]</nowiki></tt> page regardless of what the including page is.
<nowiki>{{</nowiki>Missing translation|lang=es|action=include|page=Bar<nowiki>}}</nowiki>
<nowiki>{{Missing translation|lang=es|action=include|page=Bar}}</nowiki>





Revision as of 16:50, 7 July 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: Missing translation


  1. REDIRECT [[]]
[[Category:Missing translation lang-{{{1}}}|Sandbox]]


What is the result of:
{{#rel2abs:..}}? []

{{{page|{{#rel2abs:..}}}}}? []
{{lc:{{{2|{{{action|}}}}}}}}? []
default=#REDIRECT [[{{{page|{{#rel2abs:..}}}}}]]? [default=#REDIRECT [[]]]


Usage

{{Sandbox
 | lang    = <!-- UNNAMED #1 -- language code of the missing translation (see Translating for codes) -->
 | action  = <!-- UNNAMED #2 -- OPTIONAL — what to do. Default is to REDIRECT to the base page. -->
 | page    = <!-- OPTIONAL — the page name (sans enclosing [[]]) to include or redirect to -->
 }}

NOTE: If you name one of the parameters, the other also has to be named.

Sample

The following are all equivalents, as they all generate a REDIRECT directive to the upper level

{{Missing translation|es}}
{{Missing translation|es|redirect}}
{{Missing translation|lang=es}}
{{Missing translation|lang=es|redirect}}                 #  Doesn't work due to naming inconsistency
{{Missing translation|lang=es|action=redirect}}
{{Missing translation|lang=es|action=redirect|page=Foo}} # assuming the including page is [[Foo/subpage]]

If instead of REDIRECTing you want to include the parent page, the following are equivalent:

{{Missing translation|es|include}}
{{Missing translation|lang=es|include}}                 #  Doesn't work due to naming inconsistency
{{Missing translation|lang=es|action=include}}
{{Missing translation|lang=es|action=include|page=Foo}} # assuming the including page is [[Foo/subpage]]

# This would include the [[Bar]] page regardless of what the including page is.
{{Missing translation|lang=es|action=include|page=Bar}}