Template:Sandbox: Difference between revisions
Jump to navigation
Jump to search
(testing to simplify Translated Page template) |
(reorganize) |
||
(83 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. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
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]]. |
|||
<noinclude> |
|||
: <big>'''Trying to simplify the [[Template:Translated Page]]'''</big> |
|||
</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 | <font size="1">Translation of '''[[{{{page_name}}}|{{{page_display|{{{page_name}}}}}}]]'''</font> |
|||
|width=25% align=right | <font size="1">'''[{{{version_http}}} {{{version_display|original}}}]'''</font> |
|||
|- style="background:blue" |
|||
|width=75% align=left | <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> |
|||
|- |
|||
!width=75% align=left | {{:{{{page_name}}}/translations}} |
|||
|width=25% align=right | <font size="1">'''[{{{diff_http}}} {{{diff_display|diff}}}]'''</font> |
|||
|- style="background:blue" |
|||
!width=75% align=left | {{:{{{source}}}/translations}} |
|||
|width=25% align=right | <font size="1">'''[{{fullurl:{{{source}}}|diff=current&oldid={{{version}}}}} {{{diff_display|diff}}}]'''</font> |
|||
|- |
|||
⚫ | |||
</div> |
|||
category:pages translated into {{{lang}}} |
|||
⚫ | |||
category:pages translated from {{{source_lang}}} |
|||
---- |
|||
<noinclude> |
|||
: <big>'''Testing: subpage parsing'''</big> |
|||
{{fullurl:The OLPC Wiki|oldid=30534}} |
|||
; Goal |
|||
{{fullurl:The OLPC Wiki|diff=30630&oldid=30534}} |
|||
: Given "Feature roadmap/Name of feature", return "Name of feature" |
|||
: Given "Just a title", return "Just a title" |
|||
⚫ | |||
{{#sub: |
|||
{{{1}}} | |
|||
{{#if: {{#pos:{{{1}}}|/}} | |
|||
{{#expr: {{#pos:{{{1}}}|/}} + 1}} | |
|||
{{#pos:{{{1}}}|/}} |
|||
}} |
|||
⚫ | |||
pos={{#pos:{{{1}}}|/}} |
|||
{{localurl:The OLPC Wiki}} |
|||
iftest={{#if: {{#pos:{{{1}}}|/}} | |
|||
yes | |
|||
{{localurl:The OLPC Wiki|action=edit}} |
|||
no |
|||
}} |
|||
== usage == |
|||
<nowiki>{{</nowiki> Sandbox |
|||
| source = <-- Source page name—ie: "<tt>The OLPC Wiki</tt>" (sans quotes) --> | source_lang = <-- 2/3 character language-code of the source page—ie: <tt>en, es, ...</tt> --> |
|||
| lang = <-- 2/3 character language-code of the translation --> |
|||
| version = <-- Version ID# of the edition being translated or last updated --> |
|||
| source_display = <-- OPTIONAL - a string to display the source link above |
|||
default = value of ''source'' --> |
|||
| version_display = <-- OPTIONAL - a string to display for the link to the version translated |
|||
default = "<tt>original</tt>" --> |
|||
| diff_display = <-- OPTIONAL - string to display the link to the version translated and current |
|||
default = "<tt>diff</tt>" --> |
|||
<nowiki>}}</nowiki> |
|||
== samples == |
|||
<nowiki>{{</nowiki> Sandbox | source = The OLPC Wiki | version = 30534 <nowiki>}}</nowiki> |
|||
{{ Sandbox | lang = es | source_lang = en | source = The OLPC Wiki | version = 30534 }} |
|||
</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