Template:DragonEventsTable
From Dragon Mania Legends (DML) Wiki
Template documentation |
---|
Note: portions of the template sample may not be visible without values provided. |
View or edit this template's documentation. (About template documentation) |
Example(s)
{{DragonEventsTable}}
gives:
{{DragonEventsTable|Fluorescent Blue}}
gives:
Event Name | Type | Started | Duration | Ended |
---|---|---|---|---|
Treasure Hunt (edit) | Treasure Hunt | 10 July 2023 | 21 Days | 31 July 2023 |
Treasure Hunt (edit) | Treasure Hunt | 16 March 2022 | 18 Days | 03 April 2022 |
{{DragonEventsTable|Coco Crab}}
gives:
Event Name | Type | Started | Duration | Ended |
---|---|---|---|---|
Golden Gatherer (edit) | Gold Collecting | 28 April 2024 | 3 Days | 01 May 2024 |
Dinnertime! (edit) | Feeding | 05 January 2024 | 3 Days | 08 January 2024 |
Farming Fanatic (edit) | Food Gathering | 08 December 2023 | 3 Days | 11 December 2023 |
Farming Fanatic (edit) | Food Gathering | 12 May 2023 | 3 Days | 15 May 2023 |
Golden Gatherer (edit) | Gold Collecting | 14 April 2023 | 3 Days | 17 April 2023 |
Bottomless Dungeon (edit) | Bottomless Dungeon | 20 June 2022 | 7 Days | 27 June 2022 |
Pincer Attack (edit) | Solo | 17 May 2021 | 7 Days | 24 May 2021 |
Boss Challenge (edit) | Relay | 16 November 2020 | 7 Days | 23 November 2020 |
Breeding Blitz (edit) | Chain Breeding | 20 July 2020 | 4 Days | 24 July 2020 |
Dancing Delight (edit) | Arcade | 12 September 2019 | 4 Days | 16 September 2019 |
{{DragonEventsTable|Crab}}
gives:
Event Name | Type | Started | Duration | Ended |
---|---|---|---|---|
Solo Adventure (edit) | Solo | 31 July 2023 | 7 Days | 07 August 2023 |
{{DragonEventsTable|Li'l Chick}}
gives:
Event Name | Type | Started | Duration | Ended |
---|---|---|---|---|
Sweet Search (edit) | Solo | 21 March 2016 | 10 Days 6 Hours | 31 March 2016 |
{{DragonEventsTable|Yi}}
gives:
See Also
{{DragonEventsTable-CargoRow}}
, the row template used within this one to format a row of output. The template is then reapplied to every subsequent row, and it accepts EventInfos (Cargo table) column headers as parameters; in essence, it retrieves the corresponding values from the Cargo table columns as passed to it by this template.{{Cargo}}
, the template that wraps this one in a "fit-content" HTML div to eliminate the unwanted line break inserted by cargo when|outro=
is used.{{DragonEventsTable-DPL3}}
, the backup DPL3 version of this template.{{CargoResult}}
, the template used to format a single cargo result (COUNT(*)
), since query results cannot be displayed directly without a format parameter.
DPL3 Notes
If items stored in a column are fed to it (on page save) by DPL3, you must search the fully expanded content used in the active Cargo store statement (with a value) to Special:ExpandTemplates. Your query statement must search according to that expanded wikitext to work successfully (which may include unseen parser functions, formatting etc., which is why using Special:ExpandTemplates may be key.
Debugging Info
The '
character interferes with Cargo statements that use the MATCHES
directive with multiple criteria, the overall statement which must use one type '
of quote mark, and the individual criterion which must use another type "
of quote mark(s). So, when names with either type of mark are used in a page name, this can break Cargo queries.
- Like DPL3's
include
, field order has zero bearing on order whenformat=template
is used, that's because template parameters must be usable in any position in the template. Though unlike in DPL3, where all template params are passed whenformat=template
is regardless of what's put in theinclude
, whenformat=template
Cargo does require params to be passed to be used, but field order only matters when in a default/built-in format.
{{#cargo_query: tables=EventInfos, _pageData |fields=EventInfos.type, EventInfos._pageName=Page, EventInfos.started, EventInfos.duration, EventInfos.ended |where=_pageData._fullText MATCHES '"dragon{{=}}{{#if:{{{1|}}}|{{#replace:{{{1}}}|'|\’}}|{{GetDragonName|{{#replace:{{#titleparts:{{PAGENAME}}}}|'|\’}}}}}}" "prize{{=}}{{#if:{{{1|}}}|{{#replace:{{{1}}}|'|\’}}|{{GetDragonName|{{#replace:{{#titleparts:{{PAGENAME}}}}|'|\’}}}}}}" "di{{!}}{{#if:{{{1|}}}|{{#replace:{{{1}}}|'|\’}}|{{GetDragonName|{{#replace:{{#titleparts:{{PAGENAME}}}}|'|\’}}}}}}{{!}}2" "token{{=}}{{#if:{{{1|}}}|{{#replace:{{{1}}}|'|\’}}|{{GetDragonName|{{#replace:{{#titleparts:{{PAGENAME}}}}|'|\’}}}}}}"' |join on=EventInfos._pageName=_pageData._pageName |order by=EventInfos.started ASC |named args={{{args|yes}}} |format=template |template=EventBox-DragonEventsTable-CargoRow |delimiter=\n |intro= {{{!}} class="wikitable sortable mw-collapsible" {{!}}- !Type !Event Name !Started !Duration !Ended {{!}}- |limit=200 |outro={{!}}} |default='''No events found''' }} |
As of MediaWiki 1.39.4 the following behavior occurs:
- Regular character
{{#replace:Li'l Angel|'|’}}
gives:Li’l Angel
{{#replace:{{PAGENAME}}|'|’}}
(on a page like Li'l Angel) gives:Li'l Angel
- HTML entities
{{#replace:Li'l Angel|'|’}}
gives:Li’l Angel
{{#replace:{{PAGENAME}}|'|’}}
(on a page like Li'l Angel) gives:Li'l Angel
{{#replace:Li'l Angel|'|’}}
gives:Li'l Angel
{{#replace:{{PAGENAME}}|'|’}}
(on a page like Li'l Angel) gives:Li'l Angel
- Conclusion
- The replace parser function doesn't work with
{{PAGENAME}}
in this use case.
- Important Notes
{{#replace:{{PAGENAME}}|'|\'}}
does not work in MediaWiki 1.39.4 (the suggestion on Cargo known issues page is completely incorrect). If the value of{{PAGENAME}}
isLi'l Chick
that still gives:Li'l Chick
because some magic words are needlessly HTML encoded per the ParserFunctions documentation.{{#replace:{{#titleparts:{{PAGENAME}}}}|'|\'}}
however (If the value of{{PAGENAME}}
isLi'l Chick
) gives:Li\'l Chick
but still does not work.{{#replace:{{#titleparts:{{PAGENAME}}}}|'|\’}}
however (If the value of{{PAGENAME}}
isLi'l Chick
) gives:Li\’l Chick
(works and unexpectedly even returns the same results as'
).- Use of HTML entities like the ones suggested in the Cargo docs
'
, while they work on-page, once used in a query actually broke the query and could not be used.
- URL encoding a pagename (which may not work with Cargo)
{{PAGENAMEE:Li'l}}
gives:Li%27l_Angel
{{PAGENAMEE:Li’l}}
gives:Li%E2%80%99l_Angel
Creates a table of Events a Dragon appears in, when {{DragonEventsTable}} is placed on a Dragon page. Uses Cargo to query the EventInfos table to search for matches of the template criteria that match the {{PAGENAME}} or overridden page name provided.
Parameter | Description | Type | Status | |
---|---|---|---|---|
(Override) page name | 1 | no description | Page name | optional |
args | args | Whether or not to use named parameters/arguments as opposed to numbered/unnamed parameters
| String | optional |