Module:Categories: Difference between revisions

From 2d4chan
Jump to navigation Jump to search
PathfinderWiki>Virenerus
mNo edit summary
 
m 1 revision imported
 
(No difference)

Latest revision as of 01:05, 14 February 2025

{{Categories|suffix=suffix}}

This will create categories in the format param suffix for every parameter and a given suffix.

{{Categories|Cursed|Magic|suffix=items}}

will result in the categories Magic items and Cursed items


local p = {}

function p.main(frame)
     local suffix = frame:getParent().args["suffix"];
     if suffix == nil or suffix == "" then
         suffix = ""
     else
         suffix = " "..suffix
     end

     local result = "";
     for k,v in pairs(frame:getParent().args) do
         if k ~= "suffix" then
             result = result.."[[Category:"..v..suffix.."]]";
         end
     end
     return result;
end

return p