Page 1 of 1

I don't understand the logic of a template.

Posted: Sun Jan 25, 2015 8:11 am
by coulonnus
At present we have the template: http://imslp.org/wiki/Template:MBcoll. It has a link to this collection page: http://imslp.org/wiki/Category:Michelle ... collection.In this collection some pieces are also part of the WIMA collection of retypeset scores, other arn't because they are simple scans.

If I edit the page http://imslp.org/wiki/Marcia_marziale_(Corsi,_Giovanni) I find the Misc Note: {{WIMAProject||Michelle Bernard collection}}. I would like to change it into {{MBcoll}} but afterwards the piece no longer shows up in the Michelle Bernard collection. And putting {{Michelle Bernard collection}} leads to a non-existing template. Is there any wrong field in this template?

Re: I don't understand the logic of a template.

Posted: Thu Jan 29, 2015 4:09 am
by cypressdome
The template that is adding the pieces to the Michelle Bernard collection category is the WIMAProject template. Within that template the text of the second variable ("Michelle Bernard collection" in this case) is passed to an includeonly argument in the format of "<includeonly>[[Category:{{{2}}}]]</includeonly>" which will then add whatever page on which the template is used to the category specified in the second variable. The MBcoll template has no includeonly argument and so only places text and a link to the Michelle Bernard collection category. If you plan to use the MBcoll template on pages that are not included in the WIMA project but that are also part of the Michelle Bernard collection you would have to edit the MBcoll template and add the following:

Code: Select all

<includeonly>[[Category:Michelle Bernard collection]]</includeonly>

Re: I don't understand the logic of a template.

Posted: Thu Jan 29, 2015 12:17 pm
by coulonnus
Thanks a lot, it works, but where does "Code: Select all" go? It works without this string. Or is it an artefact of this forum server?

Re: I don't understand the logic of a template.

Posted: Fri Jan 30, 2015 4:57 am
by cypressdome
That's the "code" markup available when posting a forum message. It's mainly useful for long strings and multiple lines of code since it preserves formatting such as multiple spaces within it. For example, both of what follows are identical in terms of what I've written but the one within the code markup preserves all the spaces:

Code: Select all

blah          blah          blah

blah 
          blah blah
Non-code version:
blah blah blah

blah
blah blah

So If you want to make sure that what you type out is what the reader then copies/pastes you can place it within the "code" markup.

Re: I don't understand the logic of a template.

Posted: Fri Jan 30, 2015 8:09 am
by coulonnus
Thanks again :-)