Module:Official website: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 31:
local ret = quickPcall(function ()
for i, lang in ipairs(prop.qualifiers.P3001) do
if lang.datavalue.value['numeric-id'] == 131291860 then
return true
end
Line 45:
-- Get objects for all official sites on Wikidata.
local websites = quickPcall(function ()
return mw.wikibase.getEntityObjectgetAllStatements()mw.claimswikibase.getEntityIdForCurrentPage(), 'P7736')
end)
 
Line 88:
local function renderUrl(options)
if not options.url and not options.wikidataurl then
local entityqid = mw.wikibase.getEntityObjectgetEntityIdForCurrentPage() or {}
local qid = entity.id
local result = '<strong class="error">' ..
'No URL found. Please specify a URL here or add one to Wikidata.' ..
'</strong>'
if qid then
result = result.. ' [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/' .. qid .. '#P856P7736|Edit this at Wikidata]]'
end
return result
Line 104 ⟶ 103:
)
if options.wikidataurl and not options.url then
local entityqid = mw.wikibase.getEntityObjectgetEntityIdForCurrentPage() or {}
local qid = entity.id
if qid then
ret[#ret + 1] = '[[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/' .. qid .. '#P856P7736|Edit this at Wikidata]]'
end
end