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 https://help.gamepedia.com/DPL:Parameters:_Criteria_for_Page_Selection#includematch, and https://help.gamepedia.com/DPL:Parameters:_Controlling_Output_Volume#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 DPL: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: 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.

However, 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%·,,
    |includematch = /Anteater/
    |include = {Tag}:1
}}

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

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

Advertisement