Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (tweaking)
(reorganize)
 
(66 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]]


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 translated text<strike></strike>'''</big>


'''See Also''' http://meta.wikimedia.org/wiki/Help:Template
</noinclude><div style="font-size=66%; display:{{{display|none}}}; border:1px solid orange; margin:0px; ">{{{1}}}</div><noinclude>
[[Category:Template]]


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


: <big>'''Testing: subpage parsing'''</big>
<nowiki>{{</nowiki> Sandbox
| someText
| display = { block # Object is rendered as a block element.
none # Default. Object is not rendered.
inline # Object is rendered as an inline element sized by the dimensions of the content.
inline-block # Object is rendered inline, but the contents of the object are rendered as a block element. Adjacent inline elements are rendered on the same line, space permitting.
list-item # Object is rendered as a block element, and a list-item marker is added.
table-header-group # Table header is always displayed before all other rows and row groups, and after any top captions. The header is displayed on each page spanned by a table.
table-footer-group # }
<nowiki>}}</nowiki>


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


</noinclude>
<nowiki>{{</nowiki> Sandbox
{{#sub:
| The reason is quite simple: the OLPC has made an offer (an inexpensive laptop) to national governments (not individuals or NGOs). Countries interested in the offer then decide if the offer is of their liking or not. If it is, negotiations and/or talks can start with the OLPC, and it's only then that they appear on the OLPC radar, and given a color/status depicting the level of commitment or interest.<nowiki>}}</nowiki>
{{{1}}} |
{{ Sandbox
{{#if: {{#pos:{{{1}}}|/}} |
| The reason is quite simple: the OLPC has made an offer (an inexpensive laptop) to national governments (not individuals or NGOs). Countries interested in the offer then decide if the offer is of their liking or not. If it is, negotiations and/or talks can start with the OLPC, and it's only then that they appear on the OLPC radar, and given a color/status depicting the level of commitment or interest.}}
{{#expr: {{#pos:{{{1}}}|/}} + 1}} |
: ''by default, it doesn't show...''
{{#pos:{{{1}}}|/}}
}}
}}


pos={{#pos:{{{1}}}|/}}
<nowiki>{{</nowiki> Sandbox
iftest={{#if: {{#pos:{{{1}}}|/}} |
| The reason is quite simple: the OLPC has made an offer (an inexpensive laptop) to national governments (not individuals or NGOs). Countries interested in the offer then decide if the offer is of their liking or not. If it is, negotiations and/or talks can start with the OLPC, and it's only then that they appear on the OLPC radar, and given a color/status depicting the level of commitment or interest.
yes |
| display = block<nowiki>}}</nowiki>
no
{{ Sandbox
}}
| The reason is quite simple: the OLPC has made an offer (an inexpensive laptop) to national governments (not individuals or NGOs). Countries interested in the offer then decide if the offer is of their liking or not. If it is, negotiations and/or talks can start with the OLPC, and it's only then that they appear on the OLPC radar, and given a color/status depicting the level of commitment or interest.
| display = block}}

<nowiki>{{</nowiki> Sandbox
| The reason is quite simple: the OLPC has made an offer (an inexpensive laptop) to national governments (not individuals or NGOs). Countries interested in the offer then decide if the offer is of their liking or not. If it is, negotiations and/or talks can start with the OLPC, and it's only then that they appear on the OLPC radar, and given a color/status depicting the level of commitment or interest.
| display = list-item<nowiki>}}</nowiki>
{{ Sandbox
| The reason is quite simple: the OLPC has made an offer (an inexpensive laptop) to national governments (not individuals or NGOs). Countries interested in the offer then decide if the offer is of their liking or not. If it is, negotiations and/or talks can start with the OLPC, and it's only then that they appear on the OLPC radar, and given a color/status depicting the level of commitment or interest.
| display = list-item}}
</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