Difference between revisions of "Issue:Includematch with multiple pattern"
From FollowTheScore
Line 4: | Line 4: | ||
|Version = 1.8.9 | |Version = 1.8.9 | ||
|Description = Includematch should be able to run multiple patterns on the same include | |Description = Includematch should be able to run multiple patterns on the same include | ||
− | |Status = | + | |Status = close |
}} | }} | ||
Line 34: | Line 34: | ||
== Reply == | == Reply == | ||
+ | Okay, got it myself. Sorry. | ||
+ | |||
+ | <nowiki> | ||
+ | {{#dpl: | ||
+ | |category=Car | ||
+ | |include={Car}:name,{Car¦Template:Invisible},{Car¦Template:Invisible} | ||
+ | |includematch=/color\s*=\s*Red/is,/seats\s*=\s*4/is | ||
+ | }} | ||
+ | </nowiki> | ||
+ | |||
+ | with Template:Invisible containing an "empty" page. --[[User:Tirsales|Tirsales]] 23:43, 3 January 2010 (UTC) |
Revision as of 00:43, 4 January 2010
Description: | Includematch should be able to run multiple patterns on the same include |
Extension / Version: | DPL / 1.8.9 |
Type / Status: | Change Request / close |
Problem
I want to search a single include for multiple patterns, all of which have to match. (Example: A single template car having 5 parameters name,color,size,seats,format. Now I want to search for all cars having 4 seats and red color.
AFAIK it should be possible using something akin to
{{#dpl: |category=Car |include={Car}:name |includematch=/color\s*=\s*Red/is,/seats\s*=\s*4/is }}
But this does only filter with the first pattern - if this matches, the second pattern is ignored ..
An alternative would be a way to "invisibly include" a template, so one could use
{{#dpl: |category=Car |include={Car}:name,{Car}:color,{Car}:seats |includematch=/color\s*=\s*Red/is,/seats\s*=\s*4/is |display=1,-,- }} (or whatever else syntax to include the same template multiple times, but display it only once).
Reply
Okay, got it myself. Sorry.
{{#dpl: |category=Car |include={Car}:name,{Car¦Template:Invisible},{Car¦Template:Invisible} |includematch=/color\s*=\s*Red/is,/seats\s*=\s*4/is }}
with Template:Invisible containing an "empty" page. --Tirsales 23:43, 3 January 2010 (UTC)