Template:Program: Difference between revisions

no edit summary
(add if statement)
No edit summary
Line 47: Line 47:
}}
}}
Stored: {{#cargo_query:|tables=Program|fields=ProgramName|where=ProgramName="{{{ProgramName|}}}"|format=list}}
Stored: {{#cargo_query:|tables=Program|fields=ProgramName|where=ProgramName="{{{ProgramName|}}}"|format=list}}
{{#if: {{#cargo_query:|tables=Program|fields=ProgramName|where=ProgramName="{{{ProgramName|}}}"|format=list}}
{{#ifeq: {{#cargo_query:|tables=Program|fields=ProgramName|where=ProgramName="{{{ProgramName|}}}"|format=list}} | {{{ProgramName|}}}
   | <!-- If query returns ProgramName, no category added -->
   | <!-- If query equals ProgramName, storage succeeded, no category -->
   | [[Category:Cargo Storage Failed]] <!-- If query returns "No results", add category -->
   | [[Category:Cargo Storage Failed]] <!-- If query does not match ProgramName (e.g., "No results"), add category -->
}}
}}
<div style="clear: both;"></div>
<div style="clear: both;"></div>