Changes

Jump to navigation Jump to search
no edit summary
<noinclude>
Use this template to extract the first page number from a page-page string. For instance, if (e.g. <code><nowiki>pages="23-45")</nowiki></code>, the template will return 23. If <code><nowiki>pages="234"</nowiki></code>, the template will return 234. If an empty string is passed as a value, an empty string is returned. E
'''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
</noinclude><includeonly><!--
-->{{#if: {{{pages|}}}|<!--
-->{{#vardefine: varSepPos|{{#pos: {{{pages|}}}|-}}|}}<!-- -->{{#if: {{#var: varSepPos}}|<!-- -->|<!-- separator is found: extract first pageif the separator is not the first character
--><!--
-->{{#ifeq: {{#var: varSepPos}}|0<!-- -->|<!-- separator is the first character: return empty string --><!-- -->{{#vardefine: varFirstPage|}}<!-- --><!-- -->|<!-- separator is not the first character: extract the string --><!-- -->{{#vardefine: varFirstPage|<!-- -->{{#sub: {{{pages}}}|0|{{#var: varSepPos}}|}}|<!-- -->}}<!-- vardefine --><!-- -->}}<!-- vardefine if separator is the first character
--><!--
-->|<!-- separator is not found: take the whole value of page

Navigation menu