Gamepedia Help Wiki
Register
No edit summary
Tags: Mobile edit Mobile web edit
Barky55 (talk | contribs)
 
(13 intermediate revisions by 7 users not shown)
Line 78: Line 78:
 
--Wormbo 11:01, 9 August 2015 (UTC)
 
--Wormbo 11:01, 9 August 2015 (UTC)
   
== includematch: How to suppress display of matched parameters? ==
+
== [Solved] includematch: How to suppress display of matched parameters? ==
 
I'm trying to match<pre>{{Tag|Anteater}}</pre>
 
I'm trying to match<pre>{{Tag|Anteater}}</pre>
   
Regarding https://help.gamepedia.com/DPL:Parameters:_Criteria_for_Page_Selection#includematch, and https://help.gamepedia.com/DPL:Parameters:_Controlling_Output_Volume#include
+
Regarding [[Extension:DPL3/Parameters:_Criteria_for_page_selection#includematch|includematch]], and [[Extension:DPL3/Parameters:_Controlling_output_volume#include|include]]
   
 
The DPL statement
 
The DPL statement
Line 102: Line 102:
   
 
[[User:Johnywhy|Johnywhy]] ([[User talk:Johnywhy|talk]]) 08:09, 5 June 2018 (UTC)
 
[[User:Johnywhy|Johnywhy]] ([[User talk: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 — [[User:Game widow|Game widow]] <sup><small>([[User_talk:Game widow|talk]])</small></sup> 11:15, 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 — [[User:Game widow|Game widow]] <sup><small>([[User_talk:Game widow|talk]])</small></sup> 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. The format statement is only needed to append an arbitrary delimiter character before the output of the include statement, to ensure dplreplace doesn't accidentally affect any page-names. I use ·, but it can be any character.
+
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.
   
 
<pre>
 
<pre>
Line 111: Line 111:
 
{{#dpl:
 
{{#dpl:
 
|uses = Template:Tag
 
|uses = Template:Tag
 
|format = ,\n* %PAGE%·,,
 
|includematch = /Anteater/
 
|includematch = /Anteater/
 
|include = {Tag}:1
 
|include = {Tag}:1
|format = ,\n* %PAGE%·,,
 
 
}}
 
}}
   
Line 119: Line 119:
   
 
[[User:Johnywhy|Johnywhy]] ([[User talk:Johnywhy|talk]]) 12:35, 5 June 2018 (UTC)
 
[[User:Johnywhy|Johnywhy]] ([[User talk: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
  +
<pre>ScrapAnteater
  +
Scrap3AnteaterAnteaterAnteater
  +
</pre>
  +
Therefor, you'll need to use a wildcard in the replace statement to remove all of them:
  +
<pre>{{#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 -->
  +
</pre>
  +
[[User:Johnywhy|Johnywhy]] ([[User talk:Johnywhy|talk]]) 22:11, 6 June 2018 (UTC)
  +
  +
== Pipe in example parameter? ==
  +
  +
My wiki does not like <pre>|nottitlematch=%e%|%u%</pre> and wants to interpret the second pipe as the start of another parameter. How can this example work? [[Special:Contributions/162.238.126.134|162.238.126.134]] 19:16, 27 December 2018 (UTC)
  +
  +
:Try replacing the pipe with ¦ (in Windows, ALT-0166 on keypad). [[User:Barky55|Barky55]] ([[User talk:Barky55|talk]]) 22:56, 18 July 2020 (UTC)
  +
  +
== "Scroll" duplicate ==
  +
  +
Why does "scroll" appear twice on this page? I'm integrating the Manual into [http://www.aiowiki.com/wiki/Help:DPL AIOWiki] and noticed the issue. [[User:Scientific Guy|Scientific Guy]] ([[User talk: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
  +
<pre>{{#dplvar:set|t90|{{#timel:Ymd|now - 90 days}}}}
  +
{{#dpl:category=New works
  +
|lastrevisionbefore={{#dplvar:t90}}
  +
|resultsheader=%TOTALPAGES%}}</pre>
  +
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 [[User:Barky55|Barky55]] ([[User talk:Barky55|talk]]) 22:54, 18 July 2020 (UTC)

Latest revision as of 22:57, 18 July 2020

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)