Template:Tlg: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
m (use literal brackets) |
m (41 revisions imported from templatewiki:Template:Tlg) |
||
(39 intermediate revisions by 19 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ |
|||
<includeonly><!-- |
<includeonly><!-- |
||
-->{{#if:{{{nowrap|}}} |<span class="nowrap">}}<!-- |
|||
-- begin tt face if tt=yes given |
|||
-->{{#if:{{{tt|}}}|< |
-->{{#if:{{{code|{{{tt|}}}}}} |<code> |{{#if:{{{plaincode|}}}|<code style="border:none;background:transparent;">}} }}<!-- |
||
-->{{#if:{{{kbd|}}} |<kbd>}}<!-- |
|||
-- opening brace unless braceinside=yes |
|||
-->{{#if:{{{ |
-->{{#if:{{{nowrapname|}}} |<span class="nowrap">}}<!-- |
||
-->{{#if:{{{braceinside|}}} | |<nowiki>{{</nowiki>}}<!-- |
|||
-- add subst prefix, if subst=yes given |
|||
-->{{#if:{{{subst|}}}|[[Help:Substitution|subst]]:}}<!-- |
-->{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!-- |
||
-- begin boldface if bold=yes given |
|||
-->{{#if:{{{bold|}}}|'''}}<!-- |
|||
-- begin link if not nolink=yes; add any LANG and SISTER prefixes |
|||
-->{{#if:{{{nolink|}}}||[[{{{LANG|}}}{{{SISTER|}}}<!-- |
|||
-- specify page to link to (unless nolink=yes) |
|||
-->{{#if:{{{1|}}}|{{#if:{{{anypage|}}}||{{ns:Template}}:}}{{{1|}}}|{{FULLPAGENAME}}}}|}}<!-- |
|||
-- opening brace if braceinside=yes |
|||
-->{{#if:{{{braceinside|}}}|<nowiki>{{</nowiki>}}<!-- |
|||
-- surface text of link |
|||
-->{{{1|{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|{{PAGENAME}}|{{FULLPAGENAME}}}}}}}<!-- |
|||
-- closing brace if braceinside=yes |
|||
-->{{#if:{{{braceinside|}}}|<nowiki>}}</nowiki>}}<!-- |
|||
-- end of link, unless nolink=yes |
|||
-->{{#if:{{{nolink|}}}||]]}}<!-- |
|||
-- end boldface if bold=yes |
|||
-->{{#if:{{{bold|}}}|'''}}<!-- |
|||
-- add the remaining parameters |
|||
-->{{#if:{{{2|}}}| |
|||
|{{{2}}} |
|||
}}<!-- |
|||
-->{{#if:{{{3|}}}| |
|||
|{{{3}}} |
|||
}}<!-- |
|||
-->{{#if:{{{4|}}}| |
|||
|{{{4}}} |
|||
}}<!-- |
|||
-->{{#if:{{{5|}}}| |
|||
|{{{5}}} |
|||
}}<!-- |
|||
-->{{#if:{{{6|}}}| |
|||
|{{{6}}} |
|||
}}<!-- |
|||
-->{{#if:{{{7|}}}| |
|||
|{{{7}}} |
|||
}}<!-- |
|||
-->{{#if:{{{8|}}}| |
|||
|{{{8}}} |
|||
}}<!-- |
|||
-->{{#if:{{{9|}}}| |
|||
|{{{9}}} |
|||
}}<!-- |
|||
-->{{#if:{{{10|}}}| |
|||
|{{{10}}} |
|||
}}<!-- |
|||
-->{{#if:{{{11|}}}| |
|||
|{{{11}}} |
|||
}}<!-- |
|||
-->{{#if:{{{12|}}}| |
|||
|''...'' |
|||
}}<!-- |
|||
-- closing brace unless braceinside=yes |
|||
-->{{#if:{{{braceinside|}}}||<nowiki>}}</nowiki>}}<!-- |
|||
-- end tt face if tt=yes given |
|||
-->{{#if:{{{tt|}}}|</tt>}}<!-- |
|||
-- end |
|||
--></includeonly><noinclude> |
|||
-->{{#if:{{{bold|{{{boldlink|{{{boldname|}}}}}}}}} |'''}}<!-- |
|||
==Explanation== |
|||
-->{{#if:{{{nolink|}}} |<!--then omit template link, else: |
|||
This template is a general template for inserting a template link. |
|||
-->| {{#if:{{{braceinside|}}} |<nowiki>{</nowiki>}}<!-- |
|||
-->{{!((}}:<!--(start building link with "[[:") |
|||
-->{{#ifeq:{{padleft:|1|{{{1}}}}}|: <!--i.e. if {{{1}}}'s first character is a colon, |
|||
then:--> |{{FULLPAGENAME:{{{1}}}}}<!-- |
|||
else:--> |{{#switch:{{NAMESPACE:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}}} |
|||
| {{ns:0}} = {{ns:10}}:{{#if:{{{1|}}}|{{PAGENAME:{{{1}}}}}|{{PAGENAME}}}} |
|||
| #default = {{#if:{{{1|}}}|{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME}}}} |
|||
}}}}<!-- |
|||
-->{{!}}<!--(pipe between link and label, i.e. [[:link|label]]) |
|||
-->}}<!-- |
|||
-->{{#if:{{{braceinside|}}} |<nowiki>{</nowiki>}}<!-- |
|||
label / template name: |
|||
-->{{{alttext|{{#if:{{{1|}}}|{{{1}}}|{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|{{PAGENAME}}|{{FULLPAGENAME}}}}}}}}}<!-- |
|||
-->{{#if:{{{braceinside|}}} |<nowiki>}</nowiki>}}<!-- |
|||
-->{{#if:{{{nolink|}}} | |<!-- |
|||
-->{{!))}}<!--(end link) |
|||
-->{{#if:{{{braceinside|}}} |<nowiki>}</nowiki>}}<!-- |
|||
-->}}<!-- |
|||
-->{{#if:{{{bold|{{{boldlink|{{{boldname|}}}}}}}}} |'''}}<!-- |
|||
-->{{#if:{{{nowrapname|}}} |</span>}}<!-- |
|||
-->{{#if:{{{italic|{{{italics|}}}}}} |<span style="font-style:italic;">}}<!-- |
|||
copy of {{tl|tlb}} except that it uses a non-proportional, monospaced font instead of normal text: |
|||
-->{{#ifeq:{{{2|¬}}}|¬ | ||{{#tag:nowiki|{{{2}}}}}}}<!-- |
|||
{| class="wikitable" |
|||
-->{{#ifeq:{{{3|¬}}}|¬ | ||{{#tag:nowiki|{{{3}}}}}}}<!-- |
|||
! Code |
|||
-->{{#ifeq:{{{4|¬}}}|¬ | ||{{#tag:nowiki|{{{4}}}}}}}<!-- |
|||
! Result |
|||
-->{{#ifeq:{{{5|¬}}}|¬ | ||{{#tag:nowiki|{{{5}}}}}}}<!-- |
|||
! Remark |
|||
-->{{#ifeq:{{{6|¬}}}|¬ | ||{{#tag:nowiki|{{{6}}}}}}}<!-- |
|||
|- |
|||
-->{{#ifeq:{{{7|¬}}}|¬ | ||{{#tag:nowiki|{{{7}}}}}}}<!-- |
|||
| <code><nowiki>{{tlxb|Template name}}</nowiki></code> |
|||
-->{{#ifeq:{{{8|¬}}}|¬ | ||{{#tag:nowiki|{{{8}}}}}}}<!-- |
|||
| {{tlxb|Template name}} |
|||
-->{{#ifeq:{{{9|¬}}}|¬ | ||{{#tag:nowiki|{{{9}}}}}}}<!-- |
|||
| |
|||
-->{{#ifeq:{{{10|¬}}}|¬ | ||{{#tag:nowiki|{{{10}}}}}}}<!-- |
|||
|- |
|||
-->{{#ifeq:{{{11|¬}}}|¬ | ||{{#tag:nowiki|{{{11}}}}}}}<!-- |
|||
| <code><nowiki>{{tlxb|Template name|parameter1|parameter2}}</nowiki></code> |
|||
-->{{#if:{{{12|}}} ||…}}<!-- |
|||
| {{tlxb|Template name|parameter1|parameter2}} |
|||
-->{{#if:{{{italic|{{{italics|}}}}}} |</span>}}<!-- |
|||
| |
|||
|- |
|||
| <code><nowiki>{{tlxb|Template name|parm1|parm2{{=}}foo}}</nowiki></code> |
|||
| {{tlxb|Template name|parm1|parm2{{=}}foo}} |
|||
| Equal signs need to be escaped using <code><nowiki>{{=}}</nowiki></code>. |
|||
|- |
|||
| <code><nowiki>{{tlxb}}</nowiki></code> |
|||
| {{tlxb}} |
|||
| This actually substitutes the current page name. Useful as a self-reference; won't be linked. |
|||
|- |
|||
| <code><nowiki>{{tlxb|SISTER=m:|3x}}</nowiki></code> |
|||
| {{tlxb|SISTER=m:|3x}} |
|||
| Link to page on another wiki. |
|||
|} |
|||
-->{{#if:{{{braceinside|}}} | |<nowiki>}}</nowiki>}}<!-- |
|||
I.e., it's a {{tl|tl}}-style ''template-link'' tag that boldfaces the template name, and accepts parameters. It's main use is in distinguishing between multiple templates with similar names, in documentation, talk page discussions, etc. |
|||
-->{{#if:{{{kbd|}}} |</kbd>}}<!-- |
|||
-->{{#if:{{{code|{{{tt|}}}}}}{{{plaincode|}}} |</code>}}<!-- |
|||
The rest of the documentation is for {{tl|tlx}}, which works the same way (although it doesn't currently behave sanely when no parameters are given; use {{tl|tlu}} instead). |
|||
-->{{#if:{{{nowrap|}}} |</span>}}<!-- |
|||
--></includeonly><noinclude> |
|||
{{Documentation|Template:Tlx/doc}} |
|||
{{Documentation}} |
|||
<!-- Add categories and interwikis to the /doc subpage, not here! --> |
|||
</noinclude> |
</noinclude> |