Template:SD PAGENAME: Difference between revisions

From Ring of Brodgar
Jump to navigation Jump to search
(add #sub(string) parser support parameters)
(Add special support for use inside Math statements, (+doc cleanup).)
 
Line 2: Line 2:


>{{#ifeq:{{NAMESPACE}}|{{ns:Template}}
>{{#ifeq:{{NAMESPACE}}|{{ns:Template}}
|<span style="color:{{RoB color|pagename}};"><i><nowiki>{{PAGENAME}}</nowiki></i></span>
|  {{#ifeq:{{{math|}}}|{{{math}}}
  |\definecolor{Darkslategray}{rgb}{0.18,0.31,0.31}{\color{Darkslategray}\{\{\mathsf{PAGENAME}\}\} }
  |<span style="color:{{RoB color|pagename}};"><i><nowiki>{{PAGENAME}}</nowiki></i></span>
  }}
| {{#if:{{{1|}}}
| {{#if:{{{1|}}}
  | {{#if:{{{2|}}}
  | {{#if:{{{2|}}}
    |{{#sub: {{PAGENAME}} | {{{1}}} | {{{2}}} }}
    |{{#sub: {{PAGENAME}} | {{{1}}} | {{{2}}} }}
    |{{#sub: {{PAGENAME}} | {{{1}}} }}
    |{{#sub: {{PAGENAME}} | {{{1}}} }}
    }}
    }}
  |{{PAGENAME}}
  |{{PAGENAME}}
  }}
  }}
}}</includeonly
}}</includeonly


><noinclude
><noinclude>{{documentation}}</noinclude>
 
>Alternative "{{ {{PAGENAME}}}}" display for (SharedData) template(s) previewing.<br>
Supports #sub-parser parameter input (''active outside Template namespace'').
<!--
 
---- preview testing stuff (adjusting of the main code requires) ----
{{ns:Template}}
{pagename}
{{ {{PAGENAME}} | pagename = pagename | sub-start | sub-length }}
 
-->
</noinclude>

Latest revision as of 21:02, 16 August 2022

Template documentation (for the template shown above, sometimes hidden or invisible)

Alternative {{PAGENAME}}call that displays "{{PAGENAME}}" in templates when viewing the templates directly, instead of displaying the current template name.
Mainly used in the SharedData templates.

Supports additional {{...|start(nr)|length(nr)}} input to select a sub-section of the page title.
(only active outside the template namespace).

Template SDm_PAGENAME will do the same job, but for inside Math statements. (needs to use alternative math statement).


Visit Template:SD PAGENAME/doc to edit this text! (How does this work?)