Help:Automating the work list on composer pages: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(added last paragraph telling how to proceed when including this function in a code)
mNo edit summary
Line 10: Line 10:




When included in a composer page it automatically creates an alphabetical listing of the works by the composer in subject. The optional ''<subcategory>'' parameter restricts the listing only to the pages that belong to the selected subcategory. For example:
When included in a composer page it automatically creates an alphabetical listing of the works by that composer. The optional ''<subcategory>'' parameter restricts the listing only to the pages that belong to the selected subcategory. For example:


<center>'''<nowiki>{{#SortWorks:Sacred music}}</nowiki>'''</center>
<center>'''<nowiki>{{#SortWorks:Sacred music}}</nowiki>'''</center>

Revision as of 16:36, 2 April 2016

Adding new works or editions to ChoralWiki has so far implied that two pages are created or edited: the work page; and the relevant composer page.

To simplify the add work process, especially for the benefit of new contributors, it is envisaged that composer pages are gradually modified in such a way that the work list on them is automatically updated whenever a new work or a new edition is added.

At the same time, direct links to files (pdf, midi, etc.) on the composer page are supposed to be gradually removed. This is to prevent misalignments of links between the work page and the composer page, and, especially, to ensure that copyright information and editor credits are shown before a user can download any files.

At the present time a simple function exists, which can be used to automate the work list on composer pages. The function is named SortWorks, and it should be invoked as follows:

{{#SortWorks:}}
or
{{#SortWorks:<subcategory>}}
or
{{#SortWorks:<subcategory>|cols=<number of columns>}}


When included in a composer page it automatically creates an alphabetical listing of the works by that composer. The optional <subcategory> parameter restricts the listing only to the pages that belong to the selected subcategory. For example:

{{#SortWorks:Sacred music}}

will only list the sacred works by the composer, alphabetically sorted.

If a number of columns is specified, the list of works is distributed accordingly. Otherwise, default rules are applied.

The SortWorks function is currently suitable for composer pages that are relatively simple (one or two outline levels, no works within works). It will be progressively improved and complemented with other functions, so that it will be possible to extend the work list automation to more complex composer pages, with the goal that the works list is automated on all ChoralWiki's composer pages.

Whenever a new work or a new edition is added, contributors are kindly invited to consider the automation of the work listing on the composer page using the SortWorks function.

If you include the SortWorks function on a page, the works will be shown twice, once by the previously existing code entered manually, and once by the function. Please check if all works entered manually are contained in the list created by the SortWorks function. If not, try to find the reason for the work missing and correct it. This reason may be a composer name with a different spelling or a category set incorrectly. If there are no missing works left, the previously existing code containing the manually entered works can be removed.

This page is part of the CPDL Help system.
View main help index