Examples/Parameter: randomseed (example 1): Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
m (Add a note and refine it for parser functions extension and string functions setting)
imported>FrozenPlum
m (FrozenPlum moved page Criteria for page selection/Parameter: randomseed (example 1) to Examples/Parameter: randomseed (example 1): Simplifying how things are structured)
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:


This will list pages from [[:Category:Fruit examples]], a random count of 3, with the random seed set to a new value every day. Using this on your homepage, you could present a stable set of random articles for one day and switch to another set every day.
This will list pages from [[:Category:Fruit examples]], a random count of 3, with the random seed set to a new value every day. Using this on your homepage, you could present a stable set of random articles for one day and switch to another set every day.
{{note|This example requires the [[mw:Extension:ParserFunctions|ParserFunctions]] extension and <code>[[mw:Extension:ParserFunctions|$wgPFEnableStringFunctions]]</code> set to "true" (enabled) in order to function correctly; on Miraheze, ParserFunctions is already installed, the latter setting can be found and enabled in [[meta:ManageWiki|ManageWiki]].}}
{{note|This example requires the [[mw:Extension:ParserFunctions|ParserFunctions]] extension, and it also requires <code>[[mw:Extension:ParserFunctions|$wgPFEnableStringFunctions]]</code> to be set to "true" (enabled) in order to function correctly; on Miraheze, ParserFunctions is already installed and the latter setting can be found and enabled in [[meta:ManageWiki|ManageWiki]].}}


<pre>
<pre>

Latest revision as of 22:43, 31 March 2023

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

Example

This will list pages from Category:Fruit examples, a random count of 3, with the random seed set to a new value every day. Using this on your homepage, you could present a stable set of random articles for one day and switch to another set every day.

This example requires the ParserFunctions extension, and it also requires $wgPFEnableStringFunctions to be set to "true" (enabled) in order to function correctly; on Miraheze, ParserFunctions is already installed and the latter setting can be found and enabled in ManageWiki.
{{#dpl:
|category=Fruit examples
|randomcount=3
|randomseed={{#time:Ymd}}
}}

Result

{{#dpl: |category=Fruit examples |randomcount=3 |randomseed=20240627 }}