2,276
edits
(Install package: OSW Core) |
(Update package: OSW Core) |
||
Line 239: | Line 239: | ||
local mode = p.defaultArg(args.mode, p.mode.header) | local mode = p.defaultArg(args.mode, p.mode.header) | ||
local debug = p.defaultArg(args.debug, false) | local debug = p.defaultArg(args.debug, false) | ||
local title = mw.title.getCurrentTitle() | |||
local wikitext = "" | local wikitext = "" | ||
Line 306: | Line 307: | ||
--local display_label = "" | --local display_label = "" | ||
--if (jsondata[p.keys.label] ~= nil) then display_label = p.splitString(jsondata[p.keys.label], '@')[1] end | --if (jsondata[p.keys.label] ~= nil) then display_label = p.splitString(jsondata[p.keys.label], '@')[1] end | ||
wikitext = wikitext .. "\n" .. p.setCategories({categories=jsondata[p.keys.category], sortkey=display_label}).wikitext --items | if (title.nsText ~= "Category") then wikitext = wikitext .. "\n" .. p.setCategories({categories=jsondata[p.keys.category], sortkey=display_label}).wikitext end--items | ||
wikitext = wikitext .. p.setCategories({categories=jsondata[p.keys.subcategory], sortkey=display_label}).wikitext --classes/categories | wikitext = wikitext .. p.setCategories({categories=jsondata[p.keys.subcategory], sortkey=display_label}).wikitext --classes/categories | ||
Line 372: | Line 373: | ||
else | else | ||
local p_type = p.defaultArgPath(context, {k, '@type'}, '@value') | local p_type = p.defaultArgPath(context, {k, '@type'}, '@value') | ||
if (p_type == '@id') then | if (p_type == '@id') then v = "[[" .. string.gsub(v, "Category:", ":Category:") .. "]]" end | ||
cell:wikitext( v ) | cell:wikitext( v ) | ||
end | end |