Difference between revisions of "Template:BCW-page"
Jump to navigation
Jump to search
(+ability to pass v:p and page range) |
|||
Line 8: | Line 8: | ||
'''To copy''': | '''To copy''': | ||
− | <pre>{{BCW-page|v=|p=|text=}}</pre> | + | <pre> |
+ | {{BCW-page|}} | ||
+ | {{BCW-page||text=}} | ||
+ | {{BCW-page|v=|p=}} | ||
+ | {{BCW-page|v=|p=|text=}} | ||
+ | </pre> | ||
{{Style P-No indent|where}} | {{Style P-No indent|where}} | ||
* '''text''' is a text to show as a link; if do not set this parameter, the text will be created automatically, displaying volume and page divided by colon, for example: BCW 3:58. | * '''text''' is a text to show as a link; if do not set this parameter, the text will be created automatically, displaying volume and page divided by colon, for example: BCW 3:58. | ||
+ | * Usage is similar to {{t|SB-page}}. | ||
[[Category:Templates for HPB CW]] | [[Category:Templates for HPB CW]] | ||
[[Category:Templates for references]] | [[Category:Templates for references]] | ||
− | </noinclude><includeonly><!-- | + | </noinclude><includeonly>{{#vardefine:volume|{{{v|}}}}}{{#vardefine:pages|{{{p|}}}}}<!-- |
+ | redefine variables if unnamed parameter is not empty; split string '3:258-61' | ||
+ | -->{{#if: {{{1|}}}|{{#vardefine:volume|{{#explode:{{{1}}}|:|0}}}}{{#vardefine:pages|{{#explode:{{{1}}}|:|1}}}}|}}<!-- | ||
+ | take only first page for the link (in case if passed a range: 258-61) | ||
+ | -->{{#vardefine:page|{{#explode:{{#var:pages}}|-|0}}}}<!-- | ||
set link text; use @@ as a parameter separator | set link text; use @@ as a parameter separator | ||
− | -->{{#if: {{{text|}}}| {{#vardefine:link_text|{{ | + | -->{{#if: {{{text|}}}|{{#vardefine:link_text|{{#var:page}}@@{{{text}}}}}|{{#vardefine:link_text|{{#var:page}}}}}}<!-- |
− | |||
make a request and design the output with template 'BCW page link' | make a request and design the output with template 'BCW page link' | ||
− | -->{{#ask: [[BCW volume number::{{ | + | -->{{#ask: [[BCW volume number::{{#var:volume}}]] [[Page number::{{#var:page}}]] |
|?BCW volume number = volume | |?BCW volume number = volume | ||
|? = wiki_page | |? = wiki_page |
Revision as of 09:59, 29 September 2023
This template provides the link to the certain page in "H. P. Blavatsky Collected Writings".
Link created by semantic query and template:
- [[BCW volume number]] – set in template {{HPB-CW-header}}
- [[Page number]] – set in template {{Page aside}} and {{Page aside continues}}
- {{BCW page link}} – design template
To copy:
{{BCW-page|}} {{BCW-page||text=}} {{BCW-page|v=|p=}} {{BCW-page|v=|p=|text=}}
where
- text is a text to show as a link; if do not set this parameter, the text will be created automatically, displaying volume and page divided by colon, for example: BCW 3:58.
- Usage is similar to {{SB-page}}.