Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
(testing a new to categorize)
(reorganize)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
Often you need to test an idea for a template, so try it out here.
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).


: 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). -- [[User:Xavi]]
The idea of this {{tl|Sandbox}} is to have that, a simple testing zone that will not interfere with others and avoid leaving a trail of botched attempts.


The idea of this {{tl|Sandbox}} page is to have that, a simple testing template 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
[[Category:Template]]


If you try out the template here, you have to save the template and then preview to see how it works. You can instead edit [[Test sandbox template]].
: <big>'''Testing: {{tl|Google Translations}}<strike></strike>'''</big>


'''See Also''' http://meta.wikimedia.org/wiki/Help:Template
</noinclude><span class="plainlinks">''{{{title|Google}}}{{#if:{{{ar|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Car&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ar}}]}}{{#if:{{{de|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cde&hl=en&ie=UTF-8&oe=UTF-8 {{#language:de}}]}}{{#if:{{{es|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8 {{#language:es}}]}}{{#if:{{{fr|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cfr&hl=en&ie=UTF-8&oe=UTF-8 {{#language:fr}}]}}{{#if:{{{it|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8 {{#language:it}}]}}{{#if:{{{ja|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cja&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ja}}]}}{{#if:{{{ko|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cko&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ko}}]}}{{#if:{{{pt|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8 {{#language:pt}}]}}{{#if:{{{ru|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cru&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ru}}]}}{{#if:{{{zh|}}}||'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Czh-CN&hl=en&ie=UTF-8&oe=UTF-8 {{#language:zh-CN}}]}}''</span>
[[Category:Missing translation|{{PAGENAME}}]]
[[Category:Template]]
[[Category:Missing translation{{#if:{{{ar|}}}||s lang-ar}}]]
[[Category:Missing translation{{#if:{{{de|}}}||s lang-de}}]]
[[Category:Missing translation{{#if:{{{es|}}}||s lang-es}}]]
[[Category:Missing translation{{#if:{{{fr|}}}||s lang-fr}}]]
[[Category:Missing translation{{#if:{{{it|}}}||s lang-it}}]]
[[Category:Missing translation{{#if:{{{ja|}}}||s lang-ja}}]]
[[Category:Missing translation{{#if:{{{ko|}}}||s lang-ko}}]]
[[Category:Missing translation{{#if:{{{pt|}}}||s lang-pt}}]]
[[Category:Missing translation{{#if:{{{ru|}}}||s lang-ru}}]]
[[Category:Missing translation{{#if:{{{zh|}}}||s lang-zh}}]]
<noinclude>
<includeonly>[[Category:Missing translation lang-{{{lang|{{{1}}}}}}|{{PAGENAME}}]]</includeonly><noinclude>


''Please leave this comment/text above for others to read.''
== Usage ==
----


: <big>'''Testing: subpage parsing'''</big>
<nowiki>{{</nowiki>{{PAGENAME}}
| title = &lt;!-- OPTIONAL -- title (defaults to 'Google'; --&gt;
| ar = ''none'' &lt;!-- OPTIONAL -- hides link for arabic translation; --&gt;
| de = ''none'' &lt;!-- OPTIONAL -- hides link for german translation; --&gt;
| es = ''none'' &lt;!-- OPTIONAL -- hides link for spanish translation; --&gt;
| fr = ''none'' &lt;!-- OPTIONAL -- hides link for french translation; --&gt;
| it = ''none'' &lt;!-- OPTIONAL -- hides link for italian translation; --&gt;
| ja = ''none'' &lt;!-- OPTIONAL -- hides link for japanese translation; --&gt;
| ko = ''none'' &lt;!-- OPTIONAL -- hides link for korean translation; --&gt;
| pt = ''none'' &lt;!-- OPTIONAL -- hides link for portuguese translation; --&gt;
| ru = ''none'' &lt;!-- OPTIONAL -- hides link for russing translation; --&gt;
| zh = ''none'' &lt;!-- OPTIONAL -- hides link for chinese (simplified) translation --&gt;
<nowiki>}}</nowiki>


; Goal
== Sample ==
: Given "Feature roadmap/Name of feature", return "Name of feature"
: Given "Just a title", return "Just a title"


The following are all equivalents, as they all generate a <tt>REDIRECT</tt> directive to the upper level
<nowiki>{{</nowiki>{{PAGENAME}}|es=none<nowiki>}}</nowiki>
{{{{PAGENAME}}|es=none}}

[[Category:Template|{{PAGENAME}}]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]
</noinclude>
</noinclude>
{{#sub:
{{{1}}} |
{{#if: {{#pos:{{{1}}}|/}} |
{{#expr: {{#pos:{{{1}}}|/}} + 1}} |
{{#pos:{{{1}}}|/}}
}}
}}

pos={{#pos:{{{1}}}|/}}
iftest={{#if: {{#pos:{{{1}}}|/}} |
yes |
no
}}

Latest revision as of 01:31, 16 March 2009

Often you need to test an idea for a template, so try it out here.

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). -- User:Xavi

The idea of this {{Sandbox}} page is to have that, a simple testing template that will not interfere with others and avoid leaving a trail of botched attempts.

If you try out the template here, you have to save the template and then preview to see how it works. You can instead edit Test sandbox template.

See Also http://meta.wikimedia.org/wiki/Help:Template

Please leave this comment/text above for others to read.


Testing: subpage parsing
Goal
Given "Feature roadmap/Name of feature", return "Name of feature"
Given "Just a title", return "Just a title"


{{#sub:

 {{{1}}} |
 Expression error: Unrecognized punctuation character "{".

}}

pos={{#pos:{{{1}}}|/}} iftest=yes