Template:NoResultsCustomMessage: Difference between revisions

From Victory Belles Community Wiki
Jump to navigation Jump to search
m (Protected "Template:NoResultsCustomMessage": Prevent editing of templates ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
No edit summary
 
Line 1: Line 1:
{{#ifeq: {{#count: {{{1}}} | No results }} | 1 | {{{2}}} | {{{3}}} }}
{{#ifeq: {{#count: {{{1}}} | No results }} | 1 | {{{2}}} | {{{3}}} }}
<noinclude>
{{documentation}}
[[Category:Template]]
</noinclude>

Latest revision as of 12:37, 2 May 2023

{{{3}}}


Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:NoResultsCustomMessage/doc to edit this documentation. (How does this work?)

Description[edit source]

This template displays two different outcomes depending on whether a Cargo query returns data. This is distinct from the "intro, outro, default" offered by Cargo because it completely hides any Cargo output if there's no data.

  • "Intro" places text immediately preceding the Cargo data, between the table header and the data.
  • "Outro" follows an empty table since Cargo seems to qualify a template table header as "something" even if it has nothing.
  • "Default" doesn't hide the empty table header.

Syntax[edit source]

{{NoResultsCustomMessage
|1
|2
|3
}}

Supplied items could be lengthy so anonymous/unnamed variables were used.

  1. The Cargo query. It can be a template itself, or a raw query (template recommended!)
  2. The content to display if the query has no results.
  3. The content to display if the query returns something.