Difference between revisions of "Template:Tlg"
From MINR.ORG WIKI
(usage without first parameter wasn't possible on pages in the template namespace (+simplification)) |
(handle empty but specified first parameter) |
||
Line 20: | Line 20: | ||
|: | |: | ||
|{{FULLPAGENAME:{{{1}}}}} <!-- if yes: link to article ns or assume other valid link, e.g. Interwikilink --> | |{{FULLPAGENAME:{{{1}}}}} <!-- if yes: link to article ns or assume other valid link, e.g. Interwikilink --> | ||
− | |{{#switch:{{NAMESPACE:{{{1|{{FULLPAGENAME | + | |{{#switch:{{NAMESPACE:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}}} |
− | |{{ns:0}}={{ns:10}}:{{ | + | |{{ns:0}}={{ns:10}}:{{#if:{{{1|}}}|{{PAGENAME:{{{1}}}}}|{{PAGENAME}}}} <!-- No ns given: we want to link to template ns --> |
− | |#default={{ | + | |#default={{#if:{{{1|}}}|{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME}}}}<!-- |
-->}}<!-- | -->}}<!-- | ||
-->}}{{!}}<!-- <<--- pipe character in link | -->}}{{!}}<!-- <<--- pipe character in link | ||
Line 31: | Line 31: | ||
-->{{#if:{{{braceinside|}}}|<nowiki>{{</nowiki>}}<!-- | -->{{#if:{{{braceinside|}}}|<nowiki>{{</nowiki>}}<!-- | ||
-- surface text of link | -- surface text of link | ||
− | -->{{{alttext|{{{1|{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|{{PAGENAME}}|{{FULLPAGENAME | + | -->{{{alttext|{{#if:{{{1|}}}|{{{1}}}|{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|{{PAGENAME}}|{{FULLPAGENAME}}}}}}}}}<!-- |
-- closing brace if braceinside=yes | -- closing brace if braceinside=yes | ||
-->{{#if:{{{braceinside|}}}|<nowiki>}}</nowiki>}}<!-- | -->{{#if:{{{braceinside|}}}|<nowiki>}}</nowiki>}}<!-- |