Template:BCW page link: Difference between revisions

From Teopedia
(Created page with "<noinclude>{{Style P-No indent|This template makes a design of the link to the certain page in "H. P. Blavatsky Collected Writings". It is used in {{t|BCW-page}}. }...")
 
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
* two, page and text to show – show the second parameter
* two, page and text to show – show the second parameter


[[Category:Templates for BCW]]
[[Category:Templates for HPB CW]]
</noinclude><includeonly><!--  
</noinclude><includeonly><!--  
   save parameters in array
   save parameters in array
-->{{#arraydefine:parameters|{{{#userparam|}}}|@@}}<!--
-->{{#arraydefine:parameters|{{{#userparam|}}}|@@}}<!--
   first parameter (index=0) is page number; second parameter (index=1) is the text to show
   first parameter (index=0) is an anchor to the page; second parameter (index=1) is the text to show
-->{{#vardefine:page|{{#arrayindex:parameters |0}}}}<!--
-->{{#vardefine:anchor|{{#arrayindex:parameters|0}}}}<!--
  get actual page number from anchor, which could be like '36_2', see Template:Page_aside_continues for details
-->{{#vardefine:page|{{#explode:{{#var:anchor}}|_|0}}}}<!--
   set text to show;  
   set text to show;  
-->{{#switch: {{#arraysize:parameters}}  
-->{{#switch: {{#arraysize:parameters}}  
Line 17: Line 19:
  | 1 = {{#vardefine:text|BCW {{{volume}}}:{{#var:page}}}}
  | 1 = {{#vardefine:text|BCW {{{volume}}}:{{#var:page}}}}
}}<!--
}}<!--
-->[[{{{wiki_page|}}}#{{#var:page}}|{{#var:text}}]]</includeonly>
-->[[{{{wiki_page|}}}#{{#var:anchor}}|{{#var:text}}]]</includeonly>

Latest revision as of 08:23, 28 September 2023

This template makes a design of the link to the certain page in "H. P. Blavatsky Collected Writings". It is used in {{BCW-page}}.


Design depends on number of parameters passed:

  • one, just page number – make link text as such: “BCW 1:45”
  • two, page and text to show – show the second parameter