Anonymous user
Examples/Parameter: title (example 2): Difference between revisions
Examples/Parameter: title (example 2) (view source)
Revision as of 09:02, 22 April 2022
, 2 years agoAdapt this to a different use, it was not really appropriate to have on the page selection page (too complex, and that page describes entirely different use, this is more suited to the include page, though I may still leave it as "criteria for page selection" and/or "title" (I haven't decided yet).
imported>FrozenPlum m (forgot to preview) |
imported>FrozenPlum m (Adapt this to a different use, it was not really appropriate to have on the page selection page (too complex, and that page describes entirely different use, this is more suited to the include page, though I may still leave it as "criteria for page selection" and/or "title" (I haven't decided yet).) |
||
Line 6:
==Example==
This will select the [[Apple]] article, which uses [[Template:Color]] on its page more than once. The <code>{{DPL|include}}</code> statement both includes all parameters available in [[Template:Color]], '''and''' it passes their values to a surrogate template, [[Template:Color.templatevalues]] for formatting. The use of <code>{{DPL|title}}</code> is unique, it implicitly sets <code>mode=userformat</code>, which allows additional control over the output, and allows <code>{{DPL|secseparators}}</code> to be used. The first argument of <code>secseparators</code> sets nothing <code>,</code> to be displayed before each result, then its second argument sets a line break <code>\n</code> and four hyphens <code>----</code> (which create a horizontal rule/line). Another line break <code>\n</code> puts each result below that line. Without the <code>secseparators</code> statement, each result would appear side by side instead.
<pre>
Line 12:
|title=Apple
|include={Color}.templatevalues
|secseparators=,\n----\n▼
▲|secseparators=\n----\n
}}
</pre>
Line 22 ⟶ 21:
|title=Apple
|include={Color}.templatevalues
|secseparators=,\n----\n▼
▲|secseparators=\n----\n
}}
<noinclude>
[[Category:Select by title-related criteria]]
|