Jump to content
This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.

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
m (Refine the statement explaining the example)
imported>FrozenPlum
m (FrozenPlum moved page Controlling output format/Parameter: format (example 2) to Examples/Parameter: format (example 2): Simplifying how things are structured)
 
(3 intermediate revisions by the same user not shown)
Line 6:
==Example==
 
The 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), limited to a count of four. Each result will be formatted to appear on a new line and 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) times 0.5em, which will increase the font size each subsequent article.
 
<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
Cookies help us deliver our services. By using our services, you agree to our use of cookies.