Template:MultiCatList: Difference between revisions
Jump to navigation
Jump to search
(new template for listing pages common to 2 or three categories) |
(add namespace=) |
||
(15 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<!-- | <!-- | ||
This template provides a count and DPL listing of pages common to 2 or | This template provides a count and DPL listing of pages common to 2,3,4, or 5 categories | ||
More enhancements are coming, so it's not really documented yet, but: | More enhancements are coming, so it's not really documented yet, but: | ||
params 1.. | params 1..5 are for category names (3,4,5 are optional) | ||
param col=k | param col=k is for k column output (defaults to 2, where k should | ||
param skip=m | only be 1, 2, or maybe 3) | ||
param number=n | param skip=m skips the first m pages (defaults to 0) | ||
param namespace= defaults to (Main) | |||
param number=n displays up to n pages (defaults to max of 500) | |||
param not=SATB excludes works categorized in SATB | |||
param nott=Motets excludes works categorized in Motets | |||
param match=Q displays results whose title begins with Q | |||
param match=%Byrd displays results with "Byrd" somewhere in the title | |||
param match=A%{{!}}%Palestrina | |||
or | |||
param match=%Palestrina%{{!}}A | |||
both display results whose title begins with A | |||
OR have "Palestrina" somewhere in the title. | |||
Note: {{!}} is essentially a pipe inside a #dpl: declaration (ususally "|" elsewhere) but functions like a logical/boolean OR , and % is a "wildcard". Present coding automatically appends % to any match (so that if "match" is undeclared, any title will match). | |||
---> | ---> | ||
There are <includeonly>{{#dpl:category={{{1}}}|category={{{2}}}|category={{{3|{{{1}}}}}}|mode=userformat|resultsheader=%TOTALPAGES%}}</includeonly> pages common to the categories {{CiteCat|{{{1}}}}}{{#switch:{{{3|}}}|=<nowiki> </nowiki>and {{CiteCat|{{{2}}}}}|#default=, {{CiteCat|{{{2}}}}}, and {{CiteCat|{{{3}}}}}}}. | There are <includeonly>{{#dpl:category={{{1}}}|category={{{2}}}|category={{{3|{{{1}}}}}}|category={{{4|{{{1}}}}}}|category={{{5|{{{1}}}}}} | ||
:''' | |namespace= | ||
|notcategory={{{not|}}} | |||
|notcategory={{{nott|}}} | |||
|mode=userformat|resultsheader=%TOTALPAGES%}}</includeonly><noinclude>??</noinclude> pages common to the categories {{CiteCat|{{{1}}}}}{{#switch:{{{3|}}}|=<nowiki> </nowiki>and {{CiteCat|{{{2}}}}}|#default=, {{CiteCat|{{{2}}}}}, and {{CiteCat|{{{3}}}}}}}. | |||
:'''Up to {{{number|500}}} results, starting with result {{#expr:{{{skip|0}}}+1}} ... ({{#expr:{{{skip|0}}}+{{{number|500}}}}}):''' | |||
<includeonly> | |||
{{#switch:{{{3|}}}|= | {{#switch:{{{3|}}}|= | ||
{{#dpl: | {{#dpl: | ||
|category={{{1}}} | |category={{{1}}} | ||
|category={{{2}}} | |category={{{2}}} | ||
|notcategory={{{not|}}} | |||
|notcategory={{{nott|}}} | |||
|titlematch={{{match|}}}% | |||
|ordermethod=title | |ordermethod=title | ||
|order=ascending | |order=ascending | ||
|offset={{#switch:{{{skip|}}}|=0|{{{skip}}}}} | |offset={{#switch:{{{skip|}}}|=0|{{{skip}}}}} | ||
|count={{{number| | |count={{{number|500}}} | ||
|columns={{#switch:{{{col|}}}|= | |columns={{#switch:{{{col|}}}|=2|{{{col}}}}} | ||
}} | }} | ||
|#default= | |#default= | ||
Line 25: | Line 44: | ||
|category={{{2}}} | |category={{{2}}} | ||
|category={{{3}}} | |category={{{3}}} | ||
|category={{{4|{{{3}}}}}} | |||
|category={{{5|{{{3}}}}}} | |||
|notcategory={{{not|}}} | |||
|notcategory={{{nott|}}} | |||
|titlematch={{{match|}}}% | |||
|ordermethod=title | |ordermethod=title | ||
|order=ascending | |order=ascending | ||
|offset={{#switch:{{{skip|}}}|=0|{{{skip}}}}} | |offset={{#switch:{{{skip|}}}|=0|{{{skip}}}}} | ||
|count={{{number| | |count={{{number|500}}} | ||
|columns={{#switch:{{{col|}}}|=1|{{{col}}}}} | |columns={{#switch:{{{col|}}}|=1|{{{col}}}}} | ||
}} | }} | ||
}} | }} | ||
</includeonly><noinclude> | |||
[[Category:DPL templates]] | |||
[[Category:Templates]] | |||
</noinclude> |
Revision as of 02:37, 4 October 2020
There are ?? pages common to the categories [[:Category:{{{1}}}|{{{1}}}]] and [[:Category:{{{2}}}|{{{2}}}]].
- Up to 500 results, starting with result 1 ... (500):