Module:Categories

From PathfinderWiki
{{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