Template:PageCat: Difference between revisions

From TwentyOneWiki
Jump to navigation Jump to search
(Created page with "local p = {} function p.countPagesInCategory(frame) -- Получаем название категории из параметров local category = frame.args[1] if not category then return "Не указана категория" end -- Получаем количество страниц в категории local categoryInfo = mw.site.stats.pagesInCategory(category) if not categoryInfo then return "Категория...")
 
(Replaced content with "{{#invoke:CategoryCount|countPagesInCategory|{{{1}}}}}")
Tag: Replaced
 
Line 1: Line 1:
local p = {}
{{#invoke:CategoryCount|countPagesInCategory|{{{1}}}}}
 
function p.countPagesInCategory(frame)
    -- Получаем название категории из параметров
    local category = frame.args[1]
    if not category then
        return "Не указана категория"
    end
 
    -- Получаем количество страниц в категории
    local categoryInfo = mw.site.stats.pagesInCategory(category)
    if not categoryInfo then
        return "Категория не найдена"
    end
 
    return categoryInfo
end
 
return p

Latest revision as of 20:24, 14 October 2024

0