Examples/Parameter: format (example 2): Difference between revisions

m
FrozenPlum moved page Controlling output format/Parameter: format (example 2) to Examples/Parameter: format (example 2): Simplifying how things are structured
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== Below is an example of how to use the {{DPL|variables|variable}} {{code...")
 
imported>FrozenPlum
m (FrozenPlum moved page Controlling output format/Parameter: format (example 2) to Examples/Parameter: format (example 2): Simplifying how things are structured)
 
(4 intermediate revisions by the same user not shown)
Line 6:
==Example==
 
BelowThe following is an example of how to use the {{DPL|variables|variable}} <code>{{codeDPL|%NR%}}</code> to set the font size. This will list articles in [[:Category:Fruit examples]], by title (in descending order (by title), limited to a count of four,. and eachEach result will be formatted to appear on a new line withand the font size will be set using a [[mw:Help:Extension:ParserFunctions##expr|parser function (math) expression]], to calculate the current article sequence number (starting from 1). Thetimes result0.5em, iswhich thatwill increase the font size gets larger with each itemsubsequent listedarticle.
 
<pre>
<{{#dpl>:
|category category = Fruit examples
|count = 3
|ordermethod = title
|order order = descending
count = 4
|format format = ,\n<fontspan sizestyle="font-size: ²{#expr:%NR% * 0.5}²em;">'''[[%PAGE%]]'''</fontspan>,<br/>\n,
}}</dplpre>
</pre>
 
==Result==
 
<{{#dpl>:
|category category = Fruit examples
|count count = 43
|ordermethod = title
|order order = descending
|format format = ,\n<fontspan sizestyle="font-size: ²{#expr:%NR% * 0.5}²em;">'''[[%PAGE%]]'''</fontspan>,<br/>\n,
}}
</dpl>
 
<noinclude>
[[Category:Setting the basic output mode]]
Line 34 ⟶ 32:
[[Category:Uses count parameter]]
[[Category:Uses format parameter]]
[[Category:Uses ParserFunctions]]
</noinclude>
Anonymous user