Module:Itemnumber: Difference between revisions

No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 89: Line 89:
if not options.url and not options.wikidataurl then
if not options.url and not options.wikidataurl then
local qid = mw.wikibase.getEntityIdForCurrentPage()
local qid = mw.wikibase.getEntityIdForCurrentPage()
local result = '<strong class="error">' ..
local result = 'Item:' .. qid
'No URL found. Please specify a URL here or add one to Wikidata.' ..
        -- local result = '<strong class="error">' ..
'</strong>'
-- 'No URL found. Please specify a URL here or add one to Wikidata: ' .. qid ..
-- '</strong>'
if qid then
if qid then
result = result.. ' [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://wiki.tiffa.net/wiki/Item:' .. qid .. '|Edit this at Wikidata]]'
result = result.. ' [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://wiki.tiffa.net/wiki/Item:' .. qid .. '|Edit this at Wikidata]]'
Line 100: Line 101:
ret[#ret + 1] = string.format(
ret[#ret + 1] = string.format(
'<span class="official-website">%s</span>',
'<span class="official-website">%s</span>',
makeUrl(options.url or options.wikidataurl) -- , options.display)
options.display
-- makeUrl(options.url or options.wikidataurl, options.display)
)
)
if options.wikidataurl and not options.url then
if options.wikidataurl and not options.url then
Line 146: Line 148:
url = url,
url = url,
wikidataurl = wikidataurl,
wikidataurl = wikidataurl,
display = args[2] or args.name or 'WB item: ',
-- display = args[2] or args.name or 'WB item: ',
display = 'WB item: ',
format = args.format,
format = args.format,
mobile = args.mobile
mobile = args.mobile