Gamepedia Help Wiki
Advertisement

Calling Multiple Templates with same parameters?

Hello,

I'm trying to create a workaround while we transition some templates, so that a few of our DPL lists will still display data from affected pages.

Basically, what I'm working with is as follows:

{{#dpl: debug=1
|category=3.5e
|category=User
|category=Deity
|category=Hero
|notcategory=Abandoned
|notcategory=Candidates for Deletion
|notcategory=Formatting Issues
|notcategory=Needs Balance
|notcategory=Stub
|notcategory=Wording Issues
|notcategory=Pantheon
|notcategory=Salient Ability
|notcategory=NPC
|notcategory=Uncategorized
|include={Deity}:align:port:favweap,{3.5e Deity}:align:port:favweap
|format=,¦- class="²{Odd-Even¦²{var:odd}²}²"\n¦ [[%PAGE%¦²{#replace:%PAGE%¦(3.5e Deity)¦}²]],\n,
|tablerow=¦¦%%,%%\n
}}|}

What I'm trying to achieve is related to the |Include Parameter. I need to be able to pull both templates, "Deity" and "3.5e Deity", and have their contents placed into the table in the same cells. They include the same parameters, and when using only one template, the table works flawlessly. The above example, however, pulls both templates information, but places the latter's in different cells stretching off the end of the established table.

Is there a way to use both templates? 207.130.206.10 16:01, 30 July 2015 (UTC)

Multiple 'category' parameters

The following is a service for those who have been scratching their heads over this effect as well. The (IMHO) bug is already reported.

It seems the semantics of multiple OR-combining category parameters being combined via "AND" is somehow broken. The following DPL should select pages from categories "DPL" or "Guides" that are also in categories "DPL Manual" or "Editing". Guides and Editing don't seem to share any pages with each other or the DPL/DPL Manual categories. They merely serve as "null operands" to use the OR separator. The DPL and DPL Manual categories have only a few pages in common, which I'd expect to be listed.

Instead, all pages from all four categories are listed:

{#dpl:
|category=DPL¦Guides
|category=DPL Manual¦Editing
}

For reference, same query without the "null operand" categories:

{#dpl:
|category=DPL
|category=DPL Manual
}


...and with only one "null operand" category:

{#dpl:
|category=DPL¦Guides
|category=DPL Manual
}


--Wormbo 11:01, 9 August 2015 (UTC)

[Solved] includematch: How to suppress display of matched parameters?

I'm trying to match

{{Tag|Anteater}}

Regarding includematch, and include

The DPL statement

    {{#dpl: 
        |uses=Template:Tag
        |includematch=/Anteater/
        |include={Tag}:1
    }}

returns the expected page list:

ScrapAnteater 
Scrap3Anteater

Problem is, it also displays the parameter "Anteater" after every page-name.

How to show only the pagenames,and suppress display of matched parameters, while still matching the parameters?

Johnywhy (talk) 08:09, 5 June 2018 (UTC)

You have no format statement. You should look at Extension:DPL3/Parameters: Controlling output format. Which wiki are you trying to use this on? if you link to the page, it would be far easier to help — Game widow (talk) 11:15, 5 June 2018 (UTC)

Solved. The format statement isn't normally required-- page-names will get listed in the output by default. The format parameter is part of my solution, but not the way you mean-- by itself it's insufficient to remove the matching text, because the matching text is added to the output (by the include statement) after the output of the format statement. The format statement has no effect on the output of the include statement. I use #dplreplace to remove the matching text put there by the include statement. I use the format statement only to append an arbitrary delimiter character before the output of the include statement, to ensure dplreplace doesn't accidentally affect any page-names (in case any page names contain the same string). I use · as delimiter, but it can be any character you want.

{{#dplreplace:

{{#dpl: 
    |uses = Template:Tag
    |format = ,\n* %PAGE%·,,
    |includematch = /Anteater/
    |include = {Tag}:1
}}

|·Anteater}}

Johnywhy (talk) 12:35, 5 June 2018 (UTC)

Robust solution: Solves 2 issues:

  • page-titles which happen to contain the same string.
  • template is transcluded more than once on any page

Page titles which contain the same string

use format statement to append an arbitrary delimiter before the string you want to remove, to ensure you don't remove the string from any page-titles which happen to contain the same string.

Multiple transclusions

If the template is transcluded more than once on any page, then the include statement will repeat the parameter for each transclude on that page. Eg

ScrapAnteater
Scrap3AnteaterAnteaterAnteater

Therefor, you'll need to use a wildcard in the replace statement to remove all of them:

{{#dplreplace:

{{#dpl: 
    |uses = Template:Tag
    |format = ,\n* %PAGE%·,,     <!-- · delimiter here. Choose any character that's unlikely to appear in any page or template title -->
    |includematch = /Anteater/
    |include = {Tag}:1
}}

|·.*}}     <!-- .* wildcard here -->

Johnywhy (talk) 22:11, 6 June 2018 (UTC)

Pipe in example parameter?

My wiki does not like

|nottitlematch=%e%|%u%

and wants to interpret the second pipe as the start of another parameter. How can this example work? 162.238.126.134 19:16, 27 December 2018 (UTC)

Try replacing the pipe with ¦ (in Windows, ALT-0166 on keypad). Barky55 (talk) 22:56, 18 July 2020 (UTC)

"Scroll" duplicate

Why does "scroll" appear twice on this page? I'm integrating the Manual into AIOWiki and noticed the issue. Scientific Guy (talk) 00:26, 12 February 2019 (UTC)

Select articles based on revision dates

None of these work, it seems, at least in a simple way. For example

{{#dplvar:set|t90|{{#timel:Ymd|now - 90 days}}}}
{{#dpl:category=New works
  |lastrevisionbefore={{#dplvar:t90}}
  |resultsheader=%TOTALPAGES%}}

gives about 500 dpl errors, like "Notice: Undefined index: rev_user_text" and "Notice: Undefined index: rev_comment", before the display (which is correct). Similar results for other parameters like firstrevisionsince and allrevisionsbefore. MW 1.33.2 with php 7.2.32 and dpl 3.3.3 Barky55 (talk) 22:54, 18 July 2020 (UTC)

Advertisement