Module:Official website: Difference between revisions

Jump to navigation Jump to search
If no URL is provided AND Wikidata is present, include the error as well as a link to edit on wikidata. Facilitates easier cleaning of Category:Official website missing URL
m (1 revision imported)
 
(If no URL is provided AND Wikidata is present, include the error as well as a link to edit on wikidata. Facilitates easier cleaning of Category:Official website missing URL)
Line 88: Line 88:
local function renderUrl(options)
local function renderUrl(options)
if not options.url and not options.wikidataurl then
if not options.url and not options.wikidataurl then
return '<strong class="error">' ..
local entity = mw.wikibase.getEntityObject() or {}
local qid = entity.id
local result = '<strong class="error">' ..
'No URL found. Please specify a URL here or add one to Wikidata.' ..
'No URL found. Please specify a URL here or add one to Wikidata.' ..
'</strong>'
'</strong>'
if qid then
result = result.. ' [[File:Blue pencil.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/' .. qid .. '#P856|Edit this at Wikidata]]'
end
return result
end
end
local ret = {}
local ret = {}
Anonymous user

Navigation menu