Jump to content

Template:Latest articles page: Difference between revisions

From openjournal
one page of the front-page feed
 
No edit summary
 
Line 25: Line 25:
|listseparators = <div class="oj-feed">,<div class="oj-entry">'''[[%PAGE%{{!}}%TITLE%]]'''<br /><span class="oj-byline">by [[User:%USER%{{!}}%USER%]] · %DATE%</span></div>,,</div>
|listseparators = <div class="oj-feed">,<div class="oj-entry">'''[[%PAGE%{{!}}%TITLE%]]'''<br /><span class="oj-byline">by [[User:%USER%{{!}}%USER%]] · %DATE%</span></div>,,</div>
|replaceintitle = /^[^\/]*\//,
|replaceintitle = /^[^\/]*\//,
|addauthor = true
|addlasteditor = true
|addeditdate = true
|addeditdate = true
|allowcachedresults = false
|allowcachedresults = false

Latest revision as of 10:16, 11 September 2026

One page of the "Latest articles" feed on the front page. Takes a literal, hardcoded offset rather than reading one from the URL: DPL's own offset-caching does not vary by query string, so two different offsets requested close together can otherwise serve each other's cached page -- confirmed the hard way, not a hypothetical. A handful of separate, ordinary wiki pages, each pinned to its own offset, has no such problem, at the cost of being a fixed number of pages rather than infinite scroll.

Parameters: offset (required), prev and next (page titles, omit whichever end doesn't apply), count (articles per page, default 10).

To add a page once there is enough new content: create the next page with offset higher than the last one by however many count is for that feed, point its prev at the page before it, and set that previous page's next to the new page.