Module:Coordinates: Difference between revisions

add support for optional qid for template:infobox observatory
(normalize decimal notation in geohack urls to positive values, for maximum compatibility with geohack, WMA and geodata)
(add support for optional qid for template:infobox observatory)
Line 485:
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories(qid)
local ret
if mw.wikibase and current_page.namespace == 0 then
local entity = qid and mw.wikibase.getEntityObject(qid) or mw.wikibase.getEntityObject()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1] then
local snaktype = entity.claims.P625[1].mainsnak.snaktype
Line 609:
if (not args[1] or not tonumber(args[1])) and not args[2] and mw.wikibase.getEntityObject() then
args[3] = args[1]; args[1] = nil
local entity = args.qid and mw.wikibase.getEntityObject(args.qid) or mw.wikibase.getEntityObject()
if entity
and entity.claims
Line 651:
text = text
.. displaytitle(contents, Notes)
.. makeWikidataCategories(args.qid)
end
if not args.nosave then
Anonymous user