More languages
More actions
(caching method v1) |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
-- This module is DEPRECATED. We turned to using DPL lists to count numbers of works in a library card. | |||
local p = {} | local p = {} | ||
function p.getWorkCount(frame) | function p.getWorkCount(frame) | ||
local category = frame.args.category or '' | local category = frame.args.category or '' | ||
local pages = mw.site.stats.pagesInCategory(category) | local pages = mw.site.stats.pagesInCategory(category) | ||
if tonumber(pages) == 1 then | if tonumber(pages) == 1 then | ||
return "1 work" | return "1 work" |
Latest revision as of 17:16, 5 November 2024
-- This module is DEPRECATED. We turned to using DPL lists to count numbers of works in a library card.
local p = {}
function p.getWorkCount(frame)
local category = frame.args.category or ''
local pages = mw.site.stats.pagesInCategory(category)
if tonumber(pages) == 1 then
return "1 work"
else
return pages .. " works"
end
end
function p.main(frame)
return p.getWorkCount(frame)
end
return p