I don't understand the logic of a template.

General help on the Wiki

Moderators: kcleung, Wiki Admins

coulonnus
active poster
Posts: 981
Joined: Thu Jul 12, 2007 8:53 am
notabot: 42
notabot2: Human
Location: Nice, France
Contact:

I don't understand the logic of a template.

Postby coulonnus » Sun Jan 25, 2015 8:11 am

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_Bernard_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?

cypressdome
active poster
Posts: 401
Joined: Fri Aug 27, 2010 1:10 am
notabot: 42
notabot2: Human
Location: the piney woods of Florida

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

Postby cypressdome » Thu Jan 29, 2015 4:09 am

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>

coulonnus
active poster
Posts: 981
Joined: Thu Jul 12, 2007 8:53 am
notabot: 42
notabot2: Human
Location: Nice, France
Contact:

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

Postby coulonnus » Thu Jan 29, 2015 12:17 pm

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?

cypressdome
active poster
Posts: 401
Joined: Fri Aug 27, 2010 1:10 am
notabot: 42
notabot2: Human
Location: the piney woods of Florida

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

Postby cypressdome » Fri Jan 30, 2015 4:57 am

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.

coulonnus
active poster
Posts: 981
Joined: Thu Jul 12, 2007 8:53 am
notabot: 42
notabot2: Human
Location: Nice, France
Contact:

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

Postby coulonnus » Fri Jan 30, 2015 8:09 am

Thanks again :-)


Return to “Moderator Requests - Help - FAQ”

Who is online

Users browsing this forum: No registered users and 2 guests