Difference between revisions of "MagazineName"
From Sega Retro
(seems to work as intended) |
|||
Line 1: | Line 1: | ||
− | <includeonly | + | <includeonly>{{#ifeq: {{{nomagname|}}} | yes || {{#cargo_query: |
− | + | tables=magnames | |
− | # | + | |fields=code,name,link,country |
− | + | |where=code="{{{1|}}}" | |
− | + | |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|}}}" |
− | + | |format=template | |
− | + | |template=MagazineName/Issue | |
− | + | }}}}{{#ifeq:{{#var:mname}}|{{#var:mnum}}|{{clearvar|mname}}}} | |
− | + | {{#if: {{#var:mname}} | |
− | #ifeq:{{#var: | + | | {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}: "{{#var:mname}}"}} |
− | + | | {{#vardefine:mnamefull|<nowiki>#</nowiki>{{#var:mnum}}}} | |
− | + | }}{{#if: {{{2|}}} | {{#ifeq:{{{noissuename|}}}|yes||{{#var:mnamefull}}{{#vardefine:mdate|({{#var:mdate}})}}}} {{#ifeq:{{{nopubdate|}}}|yes|| {{#var:mdate}}}} }}</includeonly><noinclude> | |
− | |||
− | |||
− | |||
− | # | ||
− | # | ||
− | |||
− | |||
− | # | ||
− | # | ||
− | |||
− | # | ||
− | #ifeq:{{{ | ||
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. | 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. | ||
Line 37: | Line 25: | ||
==Examples== | ==Examples== | ||
+ | {| | ||
+ | |<pre>{{MagazineName|dmuk}}</pre> | ||
+ | |} | ||
+ | Returns {{MagazineName|dmuk}} | ||
+ | |||
+ | |||
{| | {| | ||
|<pre>{{MagazineName|dmuk|12}}</pre> | |<pre>{{MagazineName|dmuk|12}}</pre> |
Revision as of 21:20, 4 July 2018
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
{{MagazineName|dmuk}} |
Returns Dreamcast Magazine (UK)
{{MagazineName|dmuk|12}} |
Returns Dreamcast Magazine (UK) #12: "No. 12" (2000-08-10)
{{MagazineName|dmuk|12|nomagname=yes}} |
Returns #12: "No. 12" (2000-08-10)
{{MagazineName|dmuk|12|noissuename=yes}} |
Returns Dreamcast Magazine (UK) 2000-08-10
{{MagazineName|dmuk|12|nopubdate=yes}} |
Returns Dreamcast Magazine (UK) #12: "No. 12"
{{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}} |
Returns #12: "No. 12"
{{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}} |
Returns 2000-08-10
{{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}} |
Returns Dreamcast Magazine (UK)