Module:Official website: Difference between revisions

Content deleted Content added
If using Wikidata property, add an icon/link in the same format as Module:EditAtWikidata, as per discussion at Template talk:Official website. Tested with sandbox, module and template test cases, and previews in articles.
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:
local function renderUrl(options)
if not options.url and not options.wikidataurl then
local entity = mw.wikibase.getEntityObject() or {}
return '<strong class="error">' ..
local qid = entity.id
returnlocal result = '<strong class="error">' ..
'No URL found. Please specify a URL here or add one to Wikidata.' ..
'</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
local ret = {}