Examples/Recent Changes: Difference between revisions
imported>FrozenPlum (Add an example of how to make a Recent Changes list with DPL3) |
imported>FrozenPlum m (Limit farther) |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
--> |
--> |
||
==Example== |
==Example== |
||
<pre>'''Recent Changes |
<pre>'''''Recent Changes''''' |
||
{{#dpl: |
{{#dpl: |
||
|namespace= |
|namespace= |
||
|allrevisionssince={{#time:Y-m-d|now -7 days}} |
|allrevisionssince={{#time:Y-m-d|now -7 days}} |
||
|count= |
|count=5 |
||
|noresultsheader=\n''No recent changes to display'' |
|noresultsheader=\n''No recent changes to display'' |
||
|format=,* [[%PAGE%|%TITLE%]]\n |
|format=,* [[%PAGE%|%TITLE%]]\n |
||
Line 18: | Line 18: | ||
==Result== |
==Result== |
||
'''Recent Changes |
'''''Recent Changes''''' |
||
{{#dpl: |
{{#dpl: |
||
|namespace= |
|namespace= |
||
|allrevisionssince={{#time:Y-m-d|now -7 days}} |
|allrevisionssince={{#time:Y-m-d|now -7 days}} |
||
|count= |
|count=5 |
||
|noresultsheader=\n* ''No recent changes to display'' |
|noresultsheader=\n* ''No recent changes to display'' |
||
|format=,* [[%PAGE%|%TITLE%]]\n |
|format=,* [[%PAGE%|%TITLE%]]\n |
Latest revision as of 23:56, 31 March 2023
Example
'''''Recent Changes''''' {{#dpl: |namespace= |allrevisionssince={{#time:Y-m-d|now -7 days}} |count=5 |noresultsheader=\n''No recent changes to display'' |format=,* [[%PAGE%|%TITLE%]]\n }}
This selects articles in the main (blank, no prefix) namespace, lists articles with a revision since 7 days before today's date, and limits result count to 20. and formats the result as each item on a new line, bulleted, and linking to the full page name (with namespace prefix). The format settings override the text to display only the page title (without namespace prefix) followed by a new line, so the next line's bullet format correctly takes effect. A header is also output if there are no resuling revisions since the date specified. Results are cached for one hour, so edits don't take immediate effect and may still take a few minutes if purged.
Result
Recent Changes {{#dpl: |namespace= |allrevisionssince=2024-06-27 |count=5 |noresultsheader=\n* No recent changes to display |format=,* %TITLE%\n }}