Examples/Parameter: table (example 2): Difference between revisions
imported>FrozenPlum (Created page with "<noinclude>{{note|Please '''do not edit''' this page unless you're wanting to edit the manual itself, it is an example included in the manual.|error}}</noinclude><!-- This is the example preloaded for testing, press "Show Preview" to see the example working (at the bottom of the page). If you save this page, it saves as a new section at the bottom of your '''User:Username/Sandbox''' --> ==Example== This will select pages in Category:Fruit examples and include the...") |
imported>FrozenPlum m (FrozenPlum moved page Controlling output format/Parameter: table (example 2) to Examples/Parameter: table (example 2): Simplifying how things are structured) |
||
(No difference)
|
Latest revision as of 23:50, 31 March 2023
Example
This will select pages in Category:Fruit examples and include the values of the "Fruit-Infobox" template's "image" and "grows" parameters, with the page title as a link in between the two template parameter values. The table statement sets the table styles to "wikitable" and "sortable" then uses -
in the second position to omit the automatic page name/link first column (so it can be moved to a different column), and then it sets the table header text. The list output count
is limited to 5 results.
Note: Other formatting (such as turning the image name into a rendered image) cannot occur within an include
statement, see the tablerow
parameter.
{{#dpl: |category = Fruit examples |include = {Fruit-Infobox}:image:[[%PAGE%|%TITLE%]]:grows |table = class="wikitable sortable",-, Image used on page, Page, Value of "grows" parameter |count = 5 }}
Result
{{#dpl: |category = Fruit examples |include = {Fruit-Infobox}:image:%TITLE%:grows |table = class="wikitable sortable",-, Image used on page, Page, Value of "grows" parameter |count = 5 }}