Difference between revisions of "MagazineName"
From Sega Retro
Scarred Sun (talk | contribs) m (Protected "Template:MagazineName": High-traffic template ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
|||
(23 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude>This template generates a full name for a magazine, given a name and an issue number (either a number or a date). This saves having to look up precise release dates of magazines, and should greatly speed up the creation of lists of articles. | + | <includeonly>{{#ifeq: {{{nomagname|}}} | yes || {{#cargo_query: |
+ | tables=magnames | ||
+ | |fields=code,name,link,country | ||
+ | |where=code="{{{1|}}}" | ||
+ | |default= | ||
+ | |format=template | ||
+ | |template=MagazineName/Name | ||
+ | }}}}{{clearvar|mname|mnum|mdate}}{{#if: {{{2|}}} | {{#cargo_query: | ||
+ | tables=issuenames | ||
+ | |fields=num,name,date,code | ||
+ | |where=code="{{{1|}}}" AND num="{{{2|}}}" | ||
+ | |default= | ||
+ | |format=template | ||
+ | |template=MagazineName/Issue | ||
+ | }}}}{{#ifeq:{{#var:mname}}|{{#var:mnum}}|{{clearvar|mname}}}} {{ | ||
+ | #if: {{#var:mname}} | ||
+ | | {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}: "{{#var:mname}}"}} | ||
+ | | {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}}} | ||
+ | }}{{#if:{{#var:mnum}}{{#var:mnum}}{{#var:mdate}}|{{#if: {{{2|}}} | {{#ifeq:{{{noissuename|}}}|yes||{{#var:mnamefull}}{{#vardefine:mdate|({{#var:mdate}})}}}} {{#ifeq:{{{nopubdate|}}}|yes|| {{#var:mdate}}}} }}|}}{{clearvar|mname|mnum|mdate}}</includeonly><noinclude> | ||
+ | This template generates a full name for a magazine, given a name and an issue number (either a number or a date). This saves having to look up precise release dates of magazines, and should greatly speed up the creation of lists of articles. | ||
==Use== | ==Use== | ||
− | <pre> | + | {| |
− | {{MagazineName|<name>|<issueno>| | + | |<pre>{{MagazineName|<name>|<issueno>|nomagname=|noissuename=|nopubdate=}}</pre> |
− | </pre> | + | |} |
− | + | By default this returns a long string - parts can be omitted using the |no(x) fields. | |
− | == | + | ==Examples== |
− | <pre>{{MagazineName|dmuk|12}}</pre> | + | {|class="prettytable" |
+ | ! Code || Result | ||
+ | |- | ||
+ | | <pre>{{MagazineName|dmuk}}</pre> | ||
+ | | {{MagazineName|dmuk}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|dmuk|12}}</pre> | ||
+ | | {{MagazineName|dmuk|12}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|dmuk|12|nomagname=yes}}</pre> | ||
+ | | {{MagazineName|dmuk|12|nomagname=yes}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|dmuk|12|noissuename=yes}}</pre> | ||
+ | | {{MagazineName|dmuk|12|noissuename=yes}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|dmuk|12|nopubdate=yes}}</pre> | ||
+ | | {{MagazineName|dmuk|12|nopubdate=yes}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}}</pre> | ||
+ | | {{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}}</pre> | ||
+ | | {{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}}</pre> | ||
+ | | {{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}} | ||
+ | |- | ||
+ | |<pre>{{MagazineName|bums|12}}</pre> | ||
+ | | {{MagazineName|bums|12}} | ||
+ | |} | ||
− | + | [[Category:Magazine templates]]</noinclude> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 18:34, 7 November 2020
This template generates a full name for a magazine, given a name and an issue number (either a number or a date). This saves having to look up precise release dates of magazines, and should greatly speed up the creation of lists of articles.
Use
{{MagazineName|<name>|<issueno>|nomagname=|noissuename=|nopubdate=}} |
By default this returns a long string - parts can be omitted using the |no(x) fields.
Examples
Code | Result |
---|---|
{{MagazineName|dmuk}} |
Dreamcast Magazine (UK) |
{{MagazineName|dmuk|12}} |
Dreamcast Magazine (UK) #12: "No. 12" (2000-08-10) |
{{MagazineName|dmuk|12|nomagname=yes}} |
#12: "No. 12" (2000-08-10) |
{{MagazineName|dmuk|12|noissuename=yes}} |
Dreamcast Magazine (UK) 2000-08-10 |
{{MagazineName|dmuk|12|nopubdate=yes}} |
Dreamcast Magazine (UK) #12: "No. 12" |
{{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}} |
#12: "No. 12" |
{{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}} |
2000-08-10 |
{{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}} |
Dreamcast Magazine (UK) |
{{MagazineName|bums|12}} |