Difference between revisions of "MagazineName"

From Sega Retro

m (Protected "Template:MagazineName": High-traffic template ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(30 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
+
|<pre>{{MagazineName|<name>|<issueno>|nomagname=|noissuename=|nopubdate=}}</pre>
| name=
+
|}
| issueno=
+
By default this returns a long string - parts can be omitted using the |no(x) fields.
| dateonly=
 
</pre>
 
If "dateonly" is set to yes, only the release date will be returned.
 
</noinclude><div style="display:none;">
 
{{#vardefine:name|{{{name}}}}}{{#vardefine:issueNo|{{{issueno}}}}}
 
  
{{#vardefine:fullname|}}
+
==Examples==
{{#switch: {{#var:name}}
+
{|class="prettytable"
| dmuk={{#vardefine:fullname|[[Dreamcast Magazine (UK)|Dreamcast Magazine]]
+
! Code || Result
{{#switch: {{#var:issueNo}}
+
|-
|1|={{#vardefine:fulldate|#1 (1999-09)}}
+
| <pre>{{MagazineName|dmuk}}</pre>
|2|={{#vardefine:fulldate|#2 (1999-10-21)}}
+
| {{MagazineName|dmuk}}
|3|={{#vardefine:fulldate|#3 (1999-11-25)}}
+
|-
|4|={{#vardefine:fulldate|#4 (1999-12-23)}}
+
|<pre>{{MagazineName|dmuk|12}}</pre>
|5|={{#vardefine:fulldate|#5 (2000-01-27)}}
+
| {{MagazineName|dmuk|12}}
|6|={{#vardefine:fulldate|#6 (2000-02-24)}}
+
|-
|7|={{#vardefine:fulldate|#7 (2000-03-23)}}
+
|<pre>{{MagazineName|dmuk|12|nomagname=yes}}</pre>
|8|={{#vardefine:fulldate|#8 (2000-04-28)}}
+
| {{MagazineName|dmuk|12|nomagname=yes}}
|9|={{#vardefine:fulldate|#9 (2000-05-18)}}
+
|-
|10|={{#vardefine:fulldate|#10 (2000-06-15)}}
+
|<pre>{{MagazineName|dmuk|12|noissuename=yes}}</pre>
|11|={{#vardefine:fulldate|#11 (2000-07-xx)}}
+
| {{MagazineName|dmuk|12|noissuename=yes}}
|12|={{#vardefine:fulldate|#12 (2000-08-10)}}
+
|-
|13|={{#vardefine:fulldate|#13 (2000-09-07)}}
+
|<pre>{{MagazineName|dmuk|12|nopubdate=yes}}</pre>
|14|={{#vardefine:fulldate|#14 (2000-10-05)}}
+
| {{MagazineName|dmuk|12|nopubdate=yes}}
|15|={{#vardefine:fulldate|#15 (200x-xx-xx)}}
+
|-
|16|={{#vardefine:fulldate|#16 (200x-xx-xx)}}
+
|<pre>{{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}}</pre>
|17|={{#vardefine:fulldate|#17 (200x-xx-xx)}}
+
| {{MagazineName|dmuk|12|nomagname=yes|nopubdate=yes}}
|18|={{#vardefine:fulldate|#18 (200x-xx-xx)}}
+
|-
|19|={{#vardefine:fulldate|#19 (200x-xx-xx)}}
+
|<pre>{{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}}</pre>
|20|={{#vardefine:fulldate|#20 (200x-xx-xx)}}
+
| {{MagazineName|dmuk|12|nomagname=yes|noissuename=yes}}
|21|={{#vardefine:fulldate|#21 (200x-xx-xx)}}
+
|-
|22|={{#vardefine:fulldate|#22 (200x-xx-xx)}}
+
|<pre>{{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}}</pre>
|23|={{#vardefine:fulldate|#23 (200x-xx-xx)}}
+
| {{MagazineName|dmuk|12|noissuename=yes|nopubdate=yes}}
|24|={{#vardefine:fulldate|#24 (200x-xx-xx)}}
+
|-
|25|={{#vardefine:fulldate|#25 (200x-xx-xx)}}
+
|<pre>{{MagazineName|bums|12}}</pre>
|26|={{#vardefine:fulldate|#26 (200x-xx-xx)}}
+
| {{MagazineName|bums|12}}
|27|={{#vardefine:fulldate|#27 (200x-xx-xx)}}
+
|}
|28|={{#vardefine:fulldate|#28 (200x-xx-xx)}}
+
 
|29|={{#vardefine:fulldate|#29 (200x-xx-xx)}}
+
[[Category:Magazine templates]]</noinclude>
|30|={{#vardefine:fulldate|#30 (2001-12-27)}}
 
|31|={{#vardefine:fulldate|#31 (2002-01-31)}}
 
|32|={{#vardefine:fulldate|#32 (2002-02-28)}}
 
|33|={{#vardefine:fulldate|#33 (2002-03-28)}}
 
|34|={{#vardefine:fulldate|#34 (2002-04-25)}}
 
}}
 
|#default=
 
}}
 
</div>{{#ifeq:{{{dateonly}}}|yes||{{#var:fullname}}}} {{#var:fulldate}}
 

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}}