Difference between revisions of "Template:Almanacco"
blackwiki>Monkbot |
blackwiki>Michael Bednarek (italics for work title.) |
||
Line 1: | Line 1: | ||
− | {{#if: {{{match|{{{dmy|}}}}}}|{{#if: {{{linkonly|}}}||Casaglia, Gherardo (2005).}}[http://almanac-gherardo-casaglia.com/index.php?{{#if: {{{dmy|}}}|Giorno={{str mid|{{{dmy}}}|1|2}}&Mese={{str mid|{{{dmy}}}|4|2}}&Anno={{str mid|{{{dmy}}}|7|4}}{{#if: {{{match|}}}|&|}}|}}{{#if: {{{match|}}}|Testo={{Replace|{{{match}}}| |_}}&Parola=Stringa|}}<nowiki> </nowiki>{{#if: {{{linkonly|}}}||"}}{{#if: {{{label|}}}|{{{label}}}|{{#if: {{{match|}}}|{{{match}}}{{#if: {{{dmy|}}}|,{{nbsp}}||}}|}}{{#if: {{{dmy|}}}|{{#switch:{{str mid|{{{dmy}}}|1|2}}|01=1|02=2|03=3|04=4|05=5|06=6|07=7|08=8|09=9|{{str mid|{{{dmy}}}|1|2}}}} {{#switch:{{str mid|{{{dmy}}}|4|2}}|01=January|02=February|03=March|04=April|05=May|06=June|07=July|08=August|09=September|10=October|11=November|12=December|(badmonth)}} {{str mid|{{{dmy}}}|7|4}}|}}}}{{#if: {{{linkonly|}}}|]|"]. L'Almanacco di Gherardo Casaglia {{in lang|it}}.}}|<span class="error">Syntax: <nowiki>{{ Almanacco | dmy=</nowiki>''dd-mm-yyyy''<nowiki> | match=</nowiki>''string''<nowiki> | label=</nowiki>''linktext''<nowiki> | linkonly=t }}</nowiki></span>}}<noinclude>{{documentation}}</noinclude> | + | {{#if: {{{match|{{{dmy|}}}}}}|{{#if: {{{linkonly|}}}||Casaglia, Gherardo (2005).}}[http://almanac-gherardo-casaglia.com/index.php?{{#if: {{{dmy|}}}|Giorno={{str mid|{{{dmy}}}|1|2}}&Mese={{str mid|{{{dmy}}}|4|2}}&Anno={{str mid|{{{dmy}}}|7|4}}{{#if: {{{match|}}}|&|}}|}}{{#if: {{{match|}}}|Testo={{Replace|{{{match}}}| |_}}&Parola=Stringa|}}<nowiki> </nowiki>{{#if: {{{linkonly|}}}||"}}{{#if: {{{label|}}}|{{{label}}}|{{#if: {{{match|}}}|''{{{match}}}''{{#if: {{{dmy|}}}|,{{nbsp}}||}}|}}{{#if: {{{dmy|}}}|{{#switch:{{str mid|{{{dmy}}}|1|2}}|01=1|02=2|03=3|04=4|05=5|06=6|07=7|08=8|09=9|{{str mid|{{{dmy}}}|1|2}}}} {{#switch:{{str mid|{{{dmy}}}|4|2}}|01=January|02=February|03=March|04=April|05=May|06=June|07=July|08=August|09=September|10=October|11=November|12=December|(badmonth)}} {{str mid|{{{dmy}}}|7|4}}|}}}}{{#if: {{{linkonly|}}}|]|"]. L'Almanacco di Gherardo Casaglia {{in lang|it}}.}}|<span class="error">Syntax: <nowiki>{{ Almanacco | dmy=</nowiki>''dd-mm-yyyy''<nowiki> | match=</nowiki>''string''<nowiki> | label=</nowiki>''linktext''<nowiki> | linkonly=t }}</nowiki></span>}}<noinclude>{{documentation}}</noinclude> |
Revision as of 11:37, 15 July 2020
Syntax: {{ Almanacco | dmy=dd-mm-yyyy | match=string | label=linktext | linkonly=t }}
Usage
This template provides a wrapper around accesses to the L'Almanacco di Gherardo Casaglia, an important online almanac of events in opera and classical music, indexed and accessed by date. Using such a wrapper helps isolate Wikipedia's links from changes in website addresses, structures and syntax.
The template allows the Almanacco to be searched by either date or text, or a combination of the two. In general, to return a single entry both the date and a text must be supplied.
Syntax of search parameters
{{ Almanacco | match=string }} {{ Almanacco | dmy=dd-mm-yyyy }} {{ Almanacco | dmy=dd-mm-yyyy | match=string }}
where
- string is a sequence of one or more words (or part words) to match exactly in the Almanacco entries. The string should not be enclosed in quotes.
- dd-mm-yyyy is a complete date, as a two-digit, zero-padded day, followed by a hyphen, a two-digit, zero-padded month, a second hyphen, and a four-digit year. E.g.: 05-07-1870 for 5 July 1870.
Syntax of display parameters
The template will automatically create a label for the link, showing the standard information about the almanac, and the input parameters in a readable format. Examples:
- {{Almanacco | dmy=02-12-1840 }}
- {{Almanacco | match=La favorite }}
- {{Almanacco | dmy=02-12-1840 | match=La favorite }}
will display as:
- Casaglia, Gherardo (2005).Template:Str mid&Mese=Template:Str mid&Anno=Template:Str mid "Template:Str mid (badmonth) Template:Str mid". L'Almanacco di Gherardo Casaglia (in Italian).
- Casaglia, Gherardo (2005). "La favorite". L'Almanacco di Gherardo Casaglia (in Italian).
- Casaglia, Gherardo (2005).Template:Str mid&Mese=Template:Str mid&Anno=Template:Str mid&Testo=La_favorite&Parola=Stringa "La favorite, Template:Str mid (badmonth) Template:Str mid". L'Almanacco di Gherardo Casaglia (in Italian).
{{ Almanacco | label=linktext }}
You can override this default linking text by using the label=linktext
option. The linktext should not include double quotes marks. Example:
- {{Almanacco | dmy=02-12-1840 | match=La favorite | label=The premiere cast of ''La favorite'' }}
will display as:
- Casaglia, Gherardo (2005).Template:Str mid&Mese=Template:Str mid&Anno=Template:Str mid&Testo=La_favorite&Parola=Stringa "The premiere cast of La favorite". L'Almanacco di Gherardo Casaglia (in Italian).
{{ Almanacco | linkonly=t }}
To suppress the rest of the words in the template output, and get the bare link on its own, include the linkonly=t
option. Example:
- {{Almanacco | dmy=02-12-1840 | match=La favorite | label=The premiere cast of ''La favorite'' | linkonly=t }}
will display as:
- Template:Str mid&Mese=Template:Str mid&Anno=Template:Str mid&Testo=La_favorite&Parola=Stringa The premiere cast of La favorite
The above documentation is transcluded from Template:Almanacco/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |