Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (on with the tweaking)
(reorganize)
 
(81 intermediate revisions by 3 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 [[Template: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]]
</noinclude>
<div style="border-top:1px solid #888888; border-bottom:1px solid #888888; margin:0px;">
{| width="100%" cellpadding="0" cellspacing="0" style="background-color:#0093d0; color:white"
|-
|width=75% align=left | &nbsp;&nbsp;<font size="1">Translation of '''[[{{{source}}}|{{{source_display|{{{source}}}}}}]]'''</font>
|width=25% align=right | <font size="1">'''[{{fullurl:{{{source}}}|oldid={{{version}}}}} {{{version_display|original}}}]'''</font>&nbsp;&nbsp;
|-
!width=75% align=left | &nbsp;&nbsp;{{:{{{source}}}/translations}}
|width=25% align=right | <font size="1">'''[{{fullurl:{{{source}}}|diff=current&amp;oldid={{{version}}}}} {{{diff_display|diff}}}]'''</font>&nbsp;&nbsp;
|-
|}
</div>category:Translations lang-{{{lang}}}<noinclude>


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>'''Trying to simplify the [[Template:Translated Page]]'''</big>


'''See Also''' http://meta.wikimedia.org/wiki/Help:Template
{{fullurl:The OLPC Wiki|oldid=30534}}
[[Category:Template]]


''Please leave this comment/text above for others to read.''
{{fullurl:The OLPC Wiki|diff=30630&amp;oldid=30534}}
----


: <big>'''Testing: subpage parsing'''</big>


; Goal
{{localurl:The OLPC Wiki}}
: Given "Feature roadmap/Name of feature", return "Name of feature"
: Given "Just a title", return "Just a title"


</noinclude>
{{localurl:The OLPC Wiki|action=edit}}
{{#sub:
{{{1}}} |
{{#if: {{#pos:{{{1}}}|/}} |
{{#expr: {{#pos:{{{1}}}|/}} + 1}} |
{{#pos:{{{1}}}|/}}
}}
}}


pos={{#pos:{{{1}}}|/}}
== usage ==
iftest={{#if: {{#pos:{{{1}}}|/}} |

yes |
<nowiki>{{</nowiki> Sandbox
no
| lang = &lt;-- 2/3 character language-code of the translation&mdash;ie: <tt>en, es, ...</tt> --&gt;
}}
| source = &lt;-- Source page name&mdash;ie: "<tt>The OLPC Wiki</tt>" (sans quotes) --&gt;
| version = &lt;-- Version ID# of the edition being translated or last updated --&gt;
| source_display = &lt;-- OPTIONAL - a string to display the source link above
default = value of ''source'' --&gt;
| version_display = &lt;-- OPTIONAL - a string to display for the link to the version translated
default = "<tt>original</tt>" --&gt;
| diff_display = &lt;-- OPTIONAL - string to display the link to the version translated and current
default = "<tt>diff</tt>" --&gt;
<nowiki>}}</nowiki>

== samples ==

<nowiki>{{</nowiki> Sandbox | lang = es | source = The OLPC Wiki | version = 30534 <nowiki>}}</nowiki>
{{ Sandbox | lang = es | source = The OLPC Wiki | version = 30534 }}
<nowiki>{{</nowiki> Sandbox | lang = es | source = The OLPC Wiki | version = 30534
| source_display = original | version_display = versión traducida | diff_display = últimos cambios <nowiki>}}</nowiki>
{{ Sandbox | lang = es | source = The OLPC Wiki | version = 30534
| source_display = original | version_display = versión traducida | diff_display = últimos cambios }}
</noinclude>

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