Jump to content

Examples/Parameter: format (example 2)

From DynamicPageList3 Manual
Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

Example

[edit source]

The following is an example of how to use the variable %NR% to set font size. This lists articles in category Fruit examples, with ordermethod set to title and order descending. The format parameter wraps the page name in a span element, using an Extension:ParserFunctions expression #expr to multiply the font size of the current page name (starting from 1) by 0.5em for each subsequent result. The results count is limited to 3.

This example requires the ParserFunctions extension to be enabled; on Miraheze, ParserFunctions is already installed and if not enabled can be enabled in ManageWiki.


Code
{{#dpl:
|category    = Fruit examples
|ordermethod = title
|order       = descending
|format      = ,\n<span style="font-size: ²{#expr:%NR% * 0.5}²em;">'''[[%PAGE%]]'''</span>,\n,
|count       = 3
}}
Result


Plum

Pear

Orange

Cookies help us deliver our services. By using our services, you agree to our use of cookies.