Template:CSW

Frequently at IMSLP we want to put a list of works in a table, with the composer in one column (surname only), and the work title in the adjacent column (without the composer’s name); and we want to link both columns to the appropriate page:

Composer Work
Legge Kubla Khan, Op. 1

If this is done without using templates, then the formatting tends to be both repetitive and lengthy, each part of the information being encoded at least twice: [[:Category:Legge, Philip|Legge]]||[[Kubla Khan, Op. 1 (Legge, Philip)|Kubla Khan, Op. 1]]

This template formats a composer’s name in one column, and a work title in the adjacent column, in a manner similar to the {{LinkCompS}} and {{NoCompS}} templates. It includes the separation formatting between the two columns of the table, but not at either side (before and after).

The composer’s name, which in a category page is usually shown in order Surname, First Names (e.g. Legge, Philip, should be entered as the first two variables, but in familiar writing order, First Names, Surname. The work title should then occupy the third variable (e.g. Kubla Khan, Op. 1):

{{CSW|Philip|Legge|Kubla Khan, Op. 1}}
Legge Kubla Khan, Op. 1

Like the NoCompS template, there are two optional parameters, omit and add, which can be used to customise the work title displayed. omit may be used to remove text from the end of the work title immediately before the composer’s name. add may be used to add extra text after the work title as part of the link. Both the omit and add variables can be used in the one template call, and can be used in any order:

{{CSW|Philip|Legge|Kubla Khan|omit=, Op. 1|add= (2004)}}
Legge Kubla Khan (2004)

N.B. the title parameter, together with the portion included using the omit variable, must together with the composer’s name make up the entire work title, or an invalid link will result. Neither the omit nor add variables may begin with a space. While these could be encoded as an HTML entity (i.e.,  ), it is rather simpler to use the shorthand variables o and a instead, as in the example below:

{{CSW|Philip|Legge|Kubla Khan,|o=Op. 1|a=2004}}
Legge Kubla Khan, 2004

This will include the required space at the level of the template call. Do not include the space for the link in the template variable or a red link will result!