Automating composer pages: Columns

Use this forum for HELP at Choral Public Domain Library as well as FEEDBACK
Post Reply
BarryJ
Posts: 178
Joined: 03 May 2014 03:33
Location: Gunnison, Colorado, USA

Automating composer pages: Columns

Post by BarryJ »

I am trying to automate composer pages, several of which have >50 works in a subcategory.
Is there a way to arrange columns below {{#SortWorks:}}?
I created a dpl script with columns (see http://www.cpdl.org/wiki/index.php/Oliver_Holden), but unfortunately it isn't accepted as automation -- the Recent Additions dialog still appears. (or could I modify the dpl script?)
Thank you.
Barry Johnston
Barry Johnston
Gunnison, U. S. A.
choralia
Site Admin
Posts: 2926
Joined: 05 Mar 2006 19:57
Location: Rome, Italy
Contact:

Re: Automating composer pages: Columns

Post by choralia »

Bcjohnston523 wrote:the Recent Additions dialog still appears
The automated add work process is unable to recognize whether a composer page is automated already, as different automation tools exist (e.g., SortWorks, DPL) and others mat be added in the future. So, the Recent Additions template is added anyway, to stay on the safe side. The template can be easily removed then. Pages where the Recent Additions template is present are traced through a dedicated category, so it is also easy to locate any instances not removed yet.
Bcjohnston523 wrote:Is there a way to arrange columns below {{#SortWorks:}}?
Currently, columns are set by {{#SortWorks:}} as follows:

- if there are up to 20 items to list, one column is used;
- if there are 21 to 40 items to list, two columns are used;
- if there are more than 40 items to list, three columns are used.

The above rules can be changed, however this requires to modify the php script. I can do that.

Max
BarryJ
Posts: 178
Joined: 03 May 2014 03:33
Location: Gunnison, Colorado, USA

Re: Automating composer pages: Columns

Post by BarryJ »

Thanks, Max! That helps a lot.
I have noticed that the length of work titles varies a lot. So it would help me if the editor could set the number of columns in {{#SortWorks:}}, perhaps defaulting to the current rules.
Thanks again.
Barry
Barry Johnston
Gunnison, U. S. A.
choralia
Site Admin
Posts: 2926
Joined: 05 Mar 2006 19:57
Location: Rome, Italy
Contact:

Re: Automating composer pages: Columns

Post by choralia »

What about a format like this:

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

So, for example, {{#SortWorks:1800 works|4}} will list all works published in 1800, distributed on four columns.

If the subcategory is not specified, all composer's works are considered. If the number of columns is not specified, the default rules apply.

Makes sense?

Max
BarryJ
Posts: 178
Joined: 03 May 2014 03:33
Location: Gunnison, Colorado, USA

Re: Automating composer pages: Columns

Post by BarryJ »

That makes sense, although
{{#SortWorks:<subcategory>|cols=<number of columns>}}
might be more consistent with other functions and templates.
But if you've already made the change, go with it.
Thanks!
Barry
Barry Johnston
Gunnison, U. S. A.
choralia
Site Admin
Posts: 2926
Joined: 05 Mar 2006 19:57
Location: Rome, Italy
Contact:

Re: Automating composer pages: Columns

Post by choralia »

Done, using the format {{#SortWorks:<subcategory>|cols=<number of columns>}}.

This page:

http://www.cpdl.org/wiki/index.php/Andrea_Gabrieli

already makes use of it, so that secular works are distributed on three columns, like sacred works (by default secular works would be distributed on two columns instead).

Please try to use it, and let me know about any glitches.

Max
BarryJ
Posts: 178
Joined: 03 May 2014 03:33
Location: Gunnison, Colorado, USA

Re: Automating composer pages: Columns

Post by BarryJ »

Thank you very much!
This helps a bunch.
I've tried this on several pages, and it works well (better distribution of columns than my dpl script).
Is this documented somewhere in CPDL?

Barry
Barry Johnston
Gunnison, U. S. A.
choralia
Site Admin
Posts: 2926
Joined: 05 Mar 2006 19:57
Location: Rome, Italy
Contact:

Re: Automating composer pages: Columns

Post by choralia »

Bcjohnston523 wrote:Is this documented somewhere in CPDL?
Yes, of course:

http://www.cpdl.org/wiki/index.php/Help ... oser_pages

I updated this help page immediately after having activated the new cols= function. The description can be improved, of course, as I'm not a native English speaker.

Max
Post Reply