Content deleted Content added
Use HTTPS for FadedPage links (from what it appears, the FadedPage book and author links will generate an HTTP 301 redirect to an HTTPS version of the URL when accessed with HTTP.) |
Add "Edit At Wikidata" link if using ID from Wikidata. Tested first with /sandbox and preview in article. |
||
(One intermediate revision by one other user not shown) | |||
Line 19:
id = trimArg(args[1]) or trimArg(args.id)
if not id then
local bestP1938 = mw.wikibase.getBestStatements(mw.wikibase.getEntityIdForCurrentPage(), 'P1938')[1]
error("Parameter id is missing. See [[Template:" .. tname .. "]] documentation")▼
if bestP1938 and bestP1938.mainsnak.snaktype == 'value' then
else▼
id = bestP1938.mainsnak.datavalue.value
if tonumber(id) then -- it's a number▼
local entity = mw.wikibase.getEntityObject() or {}
urlhead = urlheadnumb▼
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")
urlhead = urlheadname▼
id = mw.ustring.gsub(id," ", "+")▼
end
end
▲ else
end
-- Argument |name=
|