Content deleted Content added
Tom.Reding (talk | contribs) m Sync remainder, except old 'min' |
Tom.Reding (talk | contribs) +check Commons gallery property (P935) |
||
Line 129:
local ccPropVal = ccPropState.mainsnak.datavalue.value
if ccPropVal then
commonsLinks[#commonsLinks + 1] = 'Category:' .. mw.ustring.gsub(ccPropVal, 'Category:', '')
end
end
--check Commons gallery property (P935)
local cgPropState = currEntity:getBestStatements('P935')[1]
if cgPropState then
local cgPropVal = cgPropState.mainsnak.datavalue.value
if cgPropVal then
commonsLinks[#commonsLinks + 1] = cgPropVal
end
end
Line 146 ⟶ 154:
--produce {{Commons}} template(s) (ignore duplicates)
if commonsLinks[1] then --turn these into a loop if # of commons sources >= 4
commons = frame:expandTemplate{ title = 'Commons', args = { commonsLinks[1] } }
if commonsLinks[2] and
commonsLinks[ commons = commons .. frame:expandTemplate{ title = 'Commons', args = { commonsLinks[2] } }
end
if commonsLinks[3] and
commonsLinks[3] ~= commonsLinks[1] and
commonsLinks[3] ~= commonsLinks[2] then
commons = commons .. frame:expandTemplate{ title = 'Commons', args = { commonsLinks[3] } }
end
end
Line 304 ⟶ 318:
outString = outString .. '<br />' .. mw.ustring.gsub(table.concat(trackingCategories, '<br />'), '%[%[', '[[:')
outString = mw.ustring.gsub(outString, '<br /><br />', '<br />') --produced by empty ('') first/consecutive tracking cat/s
outString = mw.ustring.gsub(outString, '<br /><br />', '<br />') --jic (use while loop if #trackingCategories >= 3 or 4
end
|