Module:Gutenberg: Difference between revisions

Content deleted Content added
Add "Edit At Wikidata" link if using ID from Wikidata. Tested first with /sandbox and preview in article.
 
Line 22:
if bestP1938 and bestP1938.mainsnak.snaktype == 'value' then
id = bestP1938.mainsnak.datavalue.value
local entity = mw.wikibase.getEntityObject() or {}
tagline = tagline .. " [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/" .. entity.id .. "#P1938|Edit this at Wikidata]]"
else
error("Parameter id is missing. See [[Template:" .. tname .. "]] documentation")