Select by category-related criteria (examples): Difference between revisions
Content added Content deleted
imported>FrozenPlum m (fixes) |
imported>FrozenPlum m (Move categorymatch here and move "other" to the bottom (again, these may or may not get parceled out later to subpages)) |
||
Line 146: | Line 146: | ||
|category = NATO membership debates | Part of NATO |
|category = NATO membership debates | Part of NATO |
||
}} |
}} |
||
==categorymatch parameter== |
|||
===Begins with=== |
|||
Wildcard <code>%</code> at the end means the word must begin with whatever was specified, the ending can be anything. |
|||
<pre> |
|||
{{#dpl: |
|||
|categorymatch=Countries% |
|||
|count=3 |
|||
}} |
|||
</pre> |
|||
or |
|||
<pre> |
|||
<dpl> |
|||
categorymatch=Countries% |
|||
count=3 |
|||
</dpl> |
|||
</pre> |
|||
This selects pages that belong to any category name that begins with "Countries" (such as those in [[:Category:Country examples]]), limited to a result count of 3. |
|||
'''Result:''' |
|||
{{#dpl: |
|||
|categorymatch=Countries% |
|||
|count=3 |
|||
}} |
|||
===Ends with=== |
|||
Wildcard <code>%</code> at the beginning means the word must end with whatever was specified, the beginning can be anything. |
|||
<pre> |
|||
{{#dpl: |
|||
|categorymatch=%output pages |
|||
|count=4 |
|||
}} |
|||
</pre> |
|||
or |
|||
<pre> |
|||
<dpl> |
|||
titlematch=%output pages |
|||
</dpl> |
|||
</pre> |
|||
This selects pages that belong to any category name that ends with "output pages" (such as those pages belonging to one of the categories in [[:Category:Demo output pages]]). |
|||
'''Result:''' |
|||
{{#dpl: |
|||
|categorymatch=%output pages |
|||
}} |
|||
===Contains=== |
|||
Using a <code>%</code> (wildcard) '''on either side''' of an {{DPL|categorymatch}} argument, selects pages that belong to a category where the specified characters are found '''anywhere''' in the category name. |
|||
<pre> |
|||
{{#dpl: |
|||
|categorymatch=%demo% |
|||
|count=3 |
|||
}} |
|||
</pre> |
|||
or |
|||
<pre> |
|||
<dpl> |
|||
categorymatch=%demo% |
|||
count=3 |
|||
</dpl> |
|||
</pre> |
|||
This selects pages that belong to a category name that contains "demo" such as [[:Category:Miscellaneous demo examples]], though it does not match pages in [[:Category:Demo output pages]] because {{DPL|categorymatch}} is case-sensitive. Results in this example are limited to a count of 3. |
|||
'''Result:''' |
|||
{{#dpl: |
|||
|categorymatch=%demo% |
|||
|count=3 |
|||
}} |
|||
===Keeping spaces at beginning or end=== |
|||
Normally, if a space was in the middle of a {{DPL|categorymatch}} statement it would automatically escape it by inserting a <code>\</code> in front; however, when spaces are used at the beginning or end of a {{DPL|categorymatch}} statement, they must manually be escaped. For example, if we wanted to search for items by <code>% in %</code>, we would need to escape the spaces <code>\ in\ </code> to keep them. |
|||
<pre> |
|||
{{#dpl: |
|||
|category = Country examples |
|||
|categorymatch = %\ in\ % |
|||
|count = 5 |
|||
}} |
|||
</pre> |
|||
or |
|||
<pre> |
|||
<dpl> |
|||
categorymatch = %\ in\ % |
|||
category = Country examples |
|||
count = 5 |
|||
</dpl> |
|||
</pre> |
|||
This selects pages that belong to a category that has <code> in </code> '''anywhere''' in any category name, such as [[:Category:Countries in Africa]], [[:Category:Countries in Europe]], and [[:Category:Countries in North America]], and that are in [[:Category:Country examples]], limited to a {{DPL|count}} of 5 results. |
|||
'''Result:''' |
|||
{{#dpl: |
|||
|category = Country examples |
|||
|categorymatch=%\ in\ % |
|||
|count=5 |
|||
}} |
|||
===Multiple criteria=== |
|||
Using <code>%</code> (wildcard) on either side, for letters anywhere in a category name: |
|||
<pre> |
|||
{{#dpl: |
|||
|categorymatch=%ruit%¦%esse% |
|||
|count=6 |
|||
}} |
|||
</pre> |
|||
or |
|||
<pre> |
|||
<dpl> |
|||
categorymatch=%ruit%¦%esse% |
|||
count=6 |
|||
</dpl> |
|||
</pre> |
|||
'''Result:''' |
|||
{{#dpl: |
|||
|categorymatch=%ruit%¦%esser% |
|||
|count=6 |
|||
|order = ascending |
|||
}} |
|||
This selects pages that belong to a category that has "ruit" or "esser" in the category name, such as [[:Category:Fruit examples]] and [[:Category:Dessert examples]], limited to a {{DPL|count}} of 6 results. |
|||