Modulo:Collegamenti esterni: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
correggo cid come da discussione |
riscrivo e correggo la generazione degli elenchi delle proprietà, vedi segnalazione |
||
Riga 566:
local res = {}
local cfg = readConfig()
table.sort(orderedGroupNames)
for _, groupName in ipairs(orderedGroupNames) do
local wdLinks = {}
for _, linkConf in ipairs(cfg[groupName]) do
local templates = {}
▲ local wdLink = string.format('<tr><td>[[d:Property:%s|%s (%s)]]</td><td>%s</td><td>%s</td><td>%s</td></tr>',
for template in string.gmatch(linkConf.template or '', '[^,]+') do
table.insert(
local wdLink = string.format(formatString,
linkConf.pid,
mWikidata._getLabel({ linkConf.pid }),
linkConf.pid,
linkConf.url or '',
linkConf.cid or '',
table.concat(templates, ', '))
table.insert(wdLinks, wdLink)
end
local group = frame.args[1] == 'modulo' and▼
local group
string.format('* [[Modulo:Collegamenti esterni/%s]] (%s)', groupName, #wdLinks) or▼
mw.getCurrentFrame():expandTemplate {▼
groupName, #wdLinks)
else
local wikitable = mw.html.create('table')
groupName, groupName, #wdLinks)
wikitable
:addClass('wikitable sortable plainlinks')
:tag('tr')
:tag('th'):wikitext('Proprietà')
:tag('th'):wikitext('Formato URL')
:tag('th'):wikitext('cid')
:tag('th'):wikitext('Template equivalenti')
:allDone()
:wikitext(table.concat(wdLinks))
title = 'Cassetto',
args = { titolo = title, testo = tostring(wikitable) }
▲ titolo = string.format('[[Modulo:Collegamenti esterni/%s|%s]] (%s)', groupName, groupName, #wdLinks),
▲ }
}
end
table.insert(res, group)
end
|