Template:Home/FeaturedArticle/Pick
More actions
One Featured Article pick, taken by offset from the candidate pool defined in Template:Home/FeaturedArticle/Pool. Split out of Template:Home/FeaturedArticle so that the daily server render and the "Show another" control run the identical ask. MediaWiki:Common.js re-parses this template with a different offset on each click, which makes a swapped card byte-identical to a server-rendered one and keeps all lead and image extraction in Module:FeaturedExtract rather than duplicating any of it in JavaScript.
Parameters:
- offset: zero-based index into the title-sorted pool. Defaults to the
deterministic daily rotation (Template:Home/DailyOffset over the pool count), the same offset Template:Home/FeaturedArticle puts on its wrapper, so an unparameterised call renders the day's homepage pick.
- match: an ask condition naming one article (from Template:Home/DailyPicks/Match). When it
is set, it replaces the pool and the offset.
The pool is sorted by title and SMW returns that order stably, so a given offset resolves to the same article for as long as the pool is unchanged. When an article is added the order shifts under the offsets, which costs at most a repeat inside one reader's cycle.
Inner render: Template:Home/FeaturedArticle/Render.