Diferencia entre revisiones de «Plantilla:Clickpic»

De WikiEducator
Saltar a: navegación, buscar
m (Creación de plantilla)
 
(new version that does not rely on external images)
 
Línea 1: Línea 1:
<span class="plainlinks">[{{SERVER}}{{localurl:{{{1}}}}} {{{2}}}]</span>
+
<includeonly>[[File:{{#ifeq: {{lc:{{#sub:{{{2}}}|0|7}}}} | http:// | {{#sub:{{{2}}}|{{#expr: 1 + {{#rpos:{{{2}}}|/}}}}}} | {{#ifeq: {{lc:{{#sub:{{{2}}}|0|5}}}} | file: | {{#sub:{{{2}}}|5}} | {{#ifeq: {{lc:{{#sub:{{{2}}}|0|6}}}} | image: | {{#sub:{{{2}}}|6}} | {{{2}}} }}}}}}|link={{{1}}}]]</includeonly><noinclude>
 +
;arg1:link (page name)
 +
;arg2:image name (''or image URL for backwards compatibility'': '''deprecated''')
 +
== Example ==
 +
<code><nowiki>{{Clickpic|Main_Page|File:Next.png}}</nowiki></code> makes a clickable arrow that takes the user to the main page.
 +
 
 +
<!-- implementation debugging
 +
;arg1:{{{1}}}
 +
;arg2:{{{2}}}
 +
;first chars of arg2: {{#sub:{{{2}}}|0|7}}
 +
;lowercased first chars: {{lc:{{#sub:{{{2}}}|0|7}}}}
 +
;basename arg2: {{#ifeq: {{lc:{{#sub:{{{2}}}|0|7}}}} | http:// | {{#sub:{{{2}}}|{{#expr: 1 + {{#rpos:{{{2}}}|/}}}}}} | {{{2}}}}}
 +
;last slash: {{#rpos:{{{2}}}|/}}
 +
;after last slash: {{#sub:{{{2}}}|{{#expr: 1 + {{#rpos:{{{2}}}|/}}}}}}
 +
;without File or Image:{{#ifeq: {{lc:{{#sub:{{{2}}}|0|5}}}} | file: | {{#sub:{{{2}}}|5}} | {{#ifeq: {{lc:{{#sub:{{{2}}}|0|6}}}} | image: | {{#sub:{{{2}}}|6}} | {{{2}}} }}}}
 +
-->
 +
</noinclude>

Última revisión de 12:52 4 sep 2012

arg1
link (page name)
arg2
image name (or image URL for backwards compatibility: deprecated)

Example

{{Clickpic|Main_Page|File:Next.png}} makes a clickable arrow that takes the user to the main page.