Difference between revisions of "OmniMedia"

From Sega Retro

(Created page with "<includeonly>{{#cargo_query: tables=relationships,releases |fields=relationships.name,releases.date |where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptyp...")
 
Line 1: Line 1:
<includeonly>{{#cargo_query:
+
<includeonly>{{#vardefine:musicresult|{{#cargo_query:
 
tables=relationships,releases
 
tables=relationships,releases
 
|fields=relationships.name,releases.date
 
|fields=relationships.name,releases.date
Line 8: Line 8:
 
|format=template
 
|format=template
 
|template=OmniMedia/Cargo
 
|template=OmniMedia/Cargo
}}</includeonly><noinclude>[[Category:Sega Retro templates]]
+
|default=
 
+
}}}}{{#vardefine:bookresult|{{#cargo_query:
 +
tables=relationships,releases
 +
|fields=relationships.name,releases.date
 +
|where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptype="book"
 +
|join on=relationships.name=releases.name
 +
|group by=releases.name
 +
|order_by=releases.date
 +
|format=template
 +
|template=OmniMedia/Cargo
 +
|default=
 +
}}}}{{#vardefine:prereleaseresult|{{#cargo_query:
 +
tables=relationships,releases
 +
|fields=relationships.name,releases.date
 +
|where=relationships.relatedto="{{{1|}}}" and relationships.relationshiptype="prerelease"
 +
|join on=relationships.name=releases.name
 +
|group by=releases.name
 +
|order_by=releases.date
 +
|format=template
 +
|template=OmniMedia/Cargo
 +
|default=
 +
}}}}
 +
{{#if:{{#var:musicresult}}|'''Music:''' {{#sub:{{#var:musicresult}}|0|-2}}<br/>|}}
 +
{{#if:{{#var:bookresult}}|'''Books:''' {{#sub:{{#var:bookresult}}|0|-2}}<br/>|}}
 +
{{#if:{{#var:prereleaseresult}}|'''Prereleases:''' {{#sub:{{#var:prereleaseresult}}|0|-2}}<br/>|}}
 +
{{clearvar|musicresult|bookresult|prereleaseresult}}</includeonly><noinclude>[[Category:Sega Retro templates]]
 +
Template that generates relevant media for Omni tables, so you don't have to.
  
 +
==Examples==
 +
<pre>{{OmniMedia|Space Channel 5: Part 2}}</pre>
 
{{OmniMedia|Space Channel 5: Part 2}}
 
{{OmniMedia|Space Channel 5: Part 2}}
 
 
 
</noinclude>
 
</noinclude>

Revision as of 07:44, 20 December 2020