Template:MultiCatList: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(add matching facility, change default number of results to 500 (max allowable))
(add namespace=)
(13 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 three categories
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..3   are for category names (3rd is optional)
   params 1..5   are for category names (3,4,5 are optional)
   param col=k  is for k column output (defaults to 1, where k should
   param col=k  is for k column output (defaults to 2, where k should
                 only be 2 or maybe 3)
                 only be 1, 2, or maybe 3)
   param skip=m          skips the first m pages (defaults to 0)
   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 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=Q        displays results whose title begins with Q
   param match=%Byrd    displays results with "Byrd" somewhere in the title
   param match=%Byrd    displays results with "Byrd" somewhere in the title
Line 13: Line 16:
   param match=%Palestrina%{{!}}A
   param match=%Palestrina%{{!}}A
                         both display results whose title begins with A
                         both display results whose title begins with A
                         and have "Palestrina" somewhere in the title.
                         OR have "Palestrina" somewhere in the title.
Note: {{!}} is essentially a pipe inside a #dpl: declaration (ususally "|" elsewhere), and % is a "wildcard".  Present coding automatically appends % to any match (so that if "match" is undeclared, any title will match).
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><noinclude>??</noinclude> 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}}}}}):'''
:'''Up to {{{number|500}}} results, starting with result {{#expr:{{{skip|0}}}+1}} ... ({{#expr:{{{skip|0}}}+{{{number|500}}}}}):'''
<includeonly>
<includeonly>
Line 23: Line 30:
|category={{{1}}}
|category={{{1}}}
|category={{{2}}}
|category={{{2}}}
|notcategory={{{not|}}}
|notcategory={{{nott|}}}
|titlematch={{{match|}}}%
|titlematch={{{match|}}}%
|ordermethod=title
|ordermethod=title
Line 28: Line 37:
|offset={{#switch:{{{skip|}}}|=0|{{{skip}}}}}
|offset={{#switch:{{{skip|}}}|=0|{{{skip}}}}}
|count={{{number|500}}}
|count={{{number|500}}}
|columns={{#switch:{{{col|}}}|=1|{{{col}}}}}
|columns={{#switch:{{{col|}}}|=2|{{{col}}}}}
}}
}}
|#default=
|#default=
Line 35: Line 44:
|category={{{2}}}
|category={{{2}}}
|category={{{3}}}
|category={{{3}}}
|category={{{4|{{{3}}}}}}
|category={{{5|{{{3}}}}}}
|notcategory={{{not|}}}
|notcategory={{{nott|}}}
|titlematch={{{match|}}}%
|titlematch={{{match|}}}%
|ordermethod=title
|ordermethod=title
Line 44: Line 57:
}}
}}
</includeonly><noinclude>
</includeonly><noinclude>
[[Category:Templates|{{PAGENAME}}]]
[[Category:DPL templates]]
[[Category:Templates]]
</noinclude>
</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):