Template:LinkText: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Original text and translations may be found at {{#switch: {{{1|}}}
Original text and translations may be found at {{#switch: {{{1|}}}
|2='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}} and '''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|.}}}
|2='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}|{{{alt1|{{{2}}}}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}} and <!--
|3='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, '''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, and '''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|.}}}
-->'''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}|{{{alt2|{{{3}}}}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|.}}}<!--
|4='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, '''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, '''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|}}}, and '''{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}[[{{{5}}}]]{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}'''{{{add4|.}}}
--><span style="display:none">[[{{{list|{{{cat|{{{2}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{3}}}}}}}}} text page| ]]</span>[[Category:Works that link to text pages|{{{sort|{{LastNameFirst|{{CompFromWorkTitle}}}} }}}]]
|5='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, '''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, '''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|}}}, '''{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}[[{{{5}}}]]{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}'''{{{add4|}}}, and '''{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}[[{{{6}}}]]{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}'''{{{add5|.}}}
|3='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, <!--
|6='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, '''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, '''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|}}}, '''{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}[[{{{5}}}]]{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}'''{{{add4|}}}, '''{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}[[{{{6}}}]]{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}'''{{{add5|}}}, and '''{{{st6|{{{st|{{ptrap|{{{7}}}}}}}}}}}[[{{{7}}}]]{{{st6|{{{st|{{ptrap|{{{7}}}}}}}}}}}'''{{{add6|.}}}
-->'''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, and <!--
|#default='''{{{st|{{ptrap|{{{1}}}}}}}}[[{{{1}}}]]{{{st|{{ptrap|{{{1}}}}}}}}'''{{{2|{{{add1|.}}}}}}
-->'''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|.}}}<!--
--><span style="display:none">[[{{{list|{{{cat|{{{2}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{3}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{4}}}}}}}}} text page| ]]</span>[[Category:Works that link to text pages|{{{sort|{{LastNameFirst|{{CompFromWorkTitle}}}} }}}]]
|4='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, <!--
-->'''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, <!--
-->'''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|}}}, and <!--
-->'''{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}[[{{{5}}}]]{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}'''{{{add4|.}}}<!--
--><span style="display:none">[[{{{list|{{{cat|{{{2}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{3}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{4}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{5}}}}}}}}} text page| ]]</span>[[Category:Works that link to text pages|{{{sort|{{LastNameFirst|{{CompFromWorkTitle}}}} }}}]]
|5='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, <!--
-->'''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, <!--
-->'''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|}}}, <!--
-->'''{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}[[{{{5}}}]]{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}'''{{{add4|}}}, and <!--
-->'''{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}[[{{{6}}}]]{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}'''{{{add5|.}}}<!--
--><span style="display:none">[[{{{list|{{{cat|{{{2}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{3}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{4}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{5}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{6}}}}}}}}} text page| ]]</span>[[Category:Works that link to text pages|{{{sort|{{LastNameFirst|{{CompFromWorkTitle}}}} }}}]]
|6='''{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}[[{{{2}}}]]{{{st1|{{{st|{{ptrap|{{{2}}}}}}}}}}}'''{{{add1|}}}, <!--
-->'''{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}[[{{{3}}}]]{{{st2|{{{st|{{ptrap|{{{3}}}}}}}}}}}'''{{{add2|}}}, <!--
-->'''{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}[[{{{4}}}]]{{{st3|{{{st|{{ptrap|{{{4}}}}}}}}}}}'''{{{add3|}}}, <!--
-->'''{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}[[{{{5}}}]]{{{st4|{{{st|{{ptrap|{{{5}}}}}}}}}}}'''{{{add4|}}}, <!--
-->'''{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}[[{{{6}}}]]{{{st5|{{{st|{{ptrap|{{{6}}}}}}}}}}}'''{{{add5|}}}, and <!--
-->'''{{{st6|{{{st|{{ptrap|{{{7}}}}}}}}}}}[[{{{7}}}]]{{{st6|{{{st|{{ptrap|{{{7}}}}}}}}}}}'''{{{add6|.}}}<!--
--><span style="display:none">[[{{{list|{{{cat|{{{2}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{3}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{4}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{5}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{6}}}}}}}}} text page| ]][[{{{list|{{{cat|{{{7}}}}}}}}} text page| ]]</span>[[Category:Works that link to text pages|{{{sort|{{LastNameFirst|{{CompFromWorkTitle}}}} }}}]]
|#default='''{{{st|{{ptrap|{{{1}}}}}}}}[[{{{1}}}|{{{alt|{{{1}}}}}}]]{{{st|{{ptrap|{{{1}}}}}}}}'''{{{2|{{{add1|.}}}}}}<!--
--><span style="display:none">[[{{{list|{{{cat|{{{1}}}}}}}}} text page| ]]</span>[[Category:Works that link to text pages|{{{sort|{{LastNameFirst|{{CompFromWorkTitle}}}} }}}]]
}}<noinclude>
}}<noinclude>
{{prot-temp}}
{{prot-temp}}
Line 15: Line 36:
<pre>{{LinkText|Ave verum corpus}}</pre>
<pre>{{LinkText|Ave verum corpus}}</pre>
producing
producing
:{{LinkText|Ave verum corpus}}
:Original text and translations may be found at '''''[[Ave verum corpus]]'''''.
<pre>{{LinkText|2|Psalm 131|Wachet auf, ruft uns die Stimme}}</pre>
<pre>{{LinkText|2|Psalm 131|Wachet auf, ruft uns die Stimme}}</pre>
producing (for two pages)
producing (for two pages)
:{{LinkText|2|Psalm 131|Wachet auf, ruft uns die Stimme}}
:Original text and translations may be found at '''[[Psalm 131]]''' and '''''[[Wachet auf, ruft uns die Stimme]]'''''.
and
and
<pre>{{LinkText|3|O magnum mysterium|Ave Maria|Psalm 150}}</pre>
<pre>{{LinkText|3|O magnum mysterium|Ave Maria|Psalm 150}}</pre>
producing (for three pages)
producing (for three pages)
:{{LinkText|3|O magnum mysterium|Ave Maria|Psalm 150}}
:Original text and translations may be found at '''''[[O magnum mysterium]]''''', '''''[[Ave Maria]]''''', and '''[[Psalm 150]]'''.
 
<h4>Specifying ''italics'' or plain display explicitly</h4>
<h4>Specifying ''italics'' or plain display explicitly</h4>
'''However,''' one may '''override''' this default behavior by setting the '''parameter''' <tt>st{{eq}}</tt> (for no italics) or <tt><nowiki>st=''</nowiki></tt> (for italics) as in the following example:
Another way to '''override''' default italicization behavior is by setting the '''parameter''' {{para|st}} (for no italics) or {{para|st|&#39;&#39;}} (for italics) as in the following example:
<pre>{{LinkText|Messiah|st=}}</pre>
<pre>{{LinkText|Messiah|st=}}</pre>
producing (the preferred)
producing (the preferred)
:{{LinkText|Messiah|st=}}
:Original text and translations may be found at '''[[Messiah]]'''.
When linking to more than one text, the parameter <tt>sp</tt> applies to each link display, and this can produce undesired results, such as:
When linking to more than one text, the parameter {{para|st}} applies to each link display, and this can produce undesired results, such as:
<pre>{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=''}}</pre>
<pre>{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=''}}</pre>
producing (not good)
producing (not good)
:{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=''}}
:Original text and translations may be found at '''''[[Messiah]]''''', '''''[[Pie Jesu]]''''', and '''''[[Psalm 118]]'''''.
<pre>{{LinkText|3|Messiah|Psalm 118|st=}}</pre>
<pre>{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=}}</pre>
producing (not good)
producing (not good)
:{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=}}
:Original text and translations may be found at '''[[Messiah]]''', '''[[Pie Jesu]]''', and '''[[Psalm 118]]'''.
'''For linking to 2 or 3 text pages:''' Instead of using the "blanket" parameter <tt>st</tt>, one can specify whether to italicize or not with the parameters <tt>st1</tt> (for the first parameter), <tt>st2</tt> (for the second parameter), and <tt>st3</tt> (for the third parameter).  For example,
'''For linking to 2 or 3 text pages:''' Instead of using the "blanket" parameter {{para|st}}, one can specify whether to italicize or not with the parameters {{para|st1}} (for the first parameter), {{para|st2}} (for the second parameter), and {{para|st3}} (for the third parameter).  For example,
<pre>{{LinkText|3|Hallelujah|Lamentations of Jeremiah|Paulus|st1=''|st2=|st3=''}}</pre>
<pre>{{LinkText|3|Hallelujah|Lamentations of Jeremiah|Paulus|st1=''|st2=|st3=''}}</pre>
produces
produces
:{{LinkText|3|Hallelujah|Lamentations of Jeremiah|Paulus|st1=''|st2=|st3=''}}
:Original text and translations may be found at '''''[[Hallelujah]]''''', '''[[Lamentations of Jeremiah]]''', and '''''[[Paulus]]'''''.
The same result could be obtained with  
The same result could be obtained with  
<pre>{{LinkText|3|Hallelujah|Lamentations of Jeremiah|Paulus|st2=}}</pre>
<pre>{{LinkText|3|Hallelujah|Lamentations of Jeremiah|Paulus|st2=}}</pre>
since "Hallelujah" and "Paulus" would be italicized by default.
since "Hallelujah" and "Paulus" would be italicized by default.
<h4>Displaying alternate text</h4>
:To link to pages with various names, for example the Vesper Psalm ''Dixit Dominus'', one might type:
<pre>{{LinkText|Psalm_110#Clementine_Vulgate_.28Psalm_109.29|alt=Psalm CIX (110)}}</pre>
:to get
:{{LinkText|Psalm_110#Clementine_Vulgate_.28Psalm_109.29|alt=Psalm CIX (110)|cat=no}}


<h4>Extended syntax examples</h4>
<h4>Extended syntax examples</h4>
Line 48: Line 74:
<pre>{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}</pre>
<pre>{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}</pre>
produces
produces
:{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}
:Original text and translations may be found at '''''[[Ave Maria]]''' - Virgo serena''.
and
and
<pre>{{LinkText|Lamentations of Jeremiah|{{sp}}'''1:1-5'''.|st=}}</pre>
<pre>{{LinkText|Lamentations of Jeremiah|{{sp}}'''1:1-5'''.|st=}}</pre>
(note the default italics have been overridden with "<tt><nowiki>st=</nowiki></tt>") produces
(note the default italics have been overridden with "{{para|st}}") produces
:{{LinkText|Lamentations of Jeremiah|{{sp}}'''1:1-5'''.|st=}}
:Original text and translations may be found at '''[[Lamentations of Jeremiah]] 1:1-5'''.
'''For 2 or 3 links,''' use the following example:
'''For 2 or 3 links,''' use the following example:
<pre>{{LinkText|3|Psalm 126|Lamentations of Jeremiah|Psalm 95
<pre>{{LinkText|3|Psalm 126|Lamentations of Jeremiah|Psalm 95|st2=|add1=:1-9|add2={{sp}}'''1:1-5'''|add3=:3-6.}}</pre>
|st2=|add1=:1-9|add2={{sp}}'''1:1-5'''|add3=:3-6.}}</pre>
produces
produces
:{{LinkText|3|Psalm 126|Lamentations of Jeremiah|Psalm 95|st2=|add1=:1-9|add2={{sp}}'''1:1-5'''|add3=:3-6.}}
:Original text and translations may be found at '''[[Psalm 126]]''':1-9, '''[[Lamentations of Jeremiah]] 1:1-5''', and '''[[Psalm 95]]''':3-6.
 
<h4>Sort key</h4>
For automatically populated lists using {{tl|TextPageList}} or {{tl|TextAutoList}}, an optional sort key parameter can be specified using {{para|sort}} in any position:
<pre>{{LinkText|O salutaris hostia|sort=La Rue}}</pre>
(the work will be sorted by the composer surname "La Rue" instead of the standard sort key which in this case would be "Rue, Pierre de La".
 
<h4>Listing</h4>
LinkText automatically includes the Works page in lists for all text pages provided as parameters. Sometimes this is not desirable, as when LinkText is used inside a "Larger work" page. In this case, just add {{para|list|no}} to the list of parameters:
<pre>{{LinkText|Ave Maria (Traditional)|list=no}}</pre>
The obsolete parameter {{para|cat|no}} also has the same effect.
}}
}}


[[Category:Templates]]</noinclude>
[[Category:Internal link templates]]</noinclude>

Revision as of 22:24, 7 December 2020

Original text and translations may be found at [[{{{1}}}|{{{1}}}]].[[{{{1}}} text page| ]]


Documentation

Default behavior

This template provides links for up to three text pages. Its default behavior is to italicize all links except those that begin with Psalm as in:

{{LinkText|Ave verum corpus}}

producing

Original text and translations may be found at Ave verum corpus.
{{LinkText|2|Psalm 131|Wachet auf, ruft uns die Stimme}}

producing (for two pages)

Original text and translations may be found at Psalm 131 and Wachet auf, ruft uns die Stimme.

and

{{LinkText|3|O magnum mysterium|Ave Maria|Psalm 150}}

producing (for three pages)

Original text and translations may be found at O magnum mysterium, Ave Maria, and Psalm 150.

Specifying italics or plain display explicitly

Another way to override default italicization behavior is by setting the parameter |st= (for no italics) or |st='' (for italics) as in the following example:

{{LinkText|Messiah|st=}}

producing (the preferred)

Original text and translations may be found at Messiah.

When linking to more than one text, the parameter |st= applies to each link display, and this can produce undesired results, such as:

{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=''}}

producing (not good)

Original text and translations may be found at Messiah, Pie Jesu, and Psalm 118.
{{LinkText|3|Messiah|Pie Jesu|Psalm 118|st=}}

producing (not good)

Original text and translations may be found at Messiah, Pie Jesu, and Psalm 118.

For linking to 2 or 3 text pages: Instead of using the "blanket" parameter |st=, one can specify whether to italicize or not with the parameters |st1= (for the first parameter), |st2= (for the second parameter), and |st3= (for the third parameter). For example,

{{LinkText|3|Hallelujah|Lamentations of Jeremiah|Paulus|st1=''|st2=|st3=''}}

produces

Original text and translations may be found at Hallelujah, Lamentations of Jeremiah, and Paulus.

The same result could be obtained with

{{LinkText|3|Hallelujah|Lamentations of Jeremiah|Paulus|st2=}}

since "Hallelujah" and "Paulus" would be italicized by default.

Displaying alternate text

To link to pages with various names, for example the Vesper Psalm Dixit Dominus, one might type:
{{LinkText|Psalm_110#Clementine_Vulgate_.28Psalm_109.29|alt=Psalm CIX (110)}}
to get
Original text and translations may be found at Psalm CIX (110).

Extended syntax examples

To add more information after a link, when there is just one link, use the following scheme:

{{LinkText|Ave Maria|{{sp}}- ''Virgo serena''}}

produces

Original text and translations may be found at Ave Maria - Virgo serena.

and

{{LinkText|Lamentations of Jeremiah|{{sp}}'''1:1-5'''.|st=}}

(note the default italics have been overridden with "|st=") produces

Original text and translations may be found at Lamentations of Jeremiah 1:1-5.

For 2 or 3 links, use the following example:

{{LinkText|3|Psalm 126|Lamentations of Jeremiah|Psalm 95|st2=|add1=:1-9|add2={{sp}}'''1:1-5'''|add3=:3-6.}}

produces

Original text and translations may be found at Psalm 126:1-9, Lamentations of Jeremiah 1:1-5, and Psalm 95:3-6.

Sort key

For automatically populated lists using {{TextPageList}} or {{TextAutoList}}, an optional sort key parameter can be specified using |sort= in any position:

{{LinkText|O salutaris hostia|sort=La Rue}}

(the work will be sorted by the composer surname "La Rue" instead of the standard sort key which in this case would be "Rue, Pierre de La".

Listing

LinkText automatically includes the Works page in lists for all text pages provided as parameters. Sometimes this is not desirable, as when LinkText is used inside a "Larger work" page. In this case, just add |list=no to the list of parameters:

{{LinkText|Ave Maria (Traditional)|list=no}}

The obsolete parameter |cat=no also has the same effect.