« Module:Index template » : différence entre les versions
Contenu supprimé Contenu ajouté
amélioration de détails |
ajout du lien dans le titre |
||
Ligne 8 :
}
local indexToWikidata = {
-- type
['sous_titre'] = 'P1680',
['volume'] = 'P478',
Ligne 60 ⟶ 59 :
end
end
end▼
-- titre depuis Wikidata
if not args.titre then▼
local value = item:formatStatements('P1476')['value']
if value == '' then
end
if value ~= '' then
local siteLink = item:getSitelink()
if siteLink then
end
args.titre = value .. ' [[File:OOjs UI icon edit-ltr.svg|Voir et modifier les données sur Wikidata|10px|baseline|class=noviewer|link=d:' .. item.id .. '#P1476]]'
end
end
-- autres propriétés
for arg, propertyId in pairs(indexToWikidata) do
if not args[arg] then
Ligne 72 ⟶ 87 :
end
▲ if not args.titre then
▲ args.titre = item:getLabel()
▲ end
▲ args.titre = '[[' .. item:getSitelink() .. '|' .. args.titre .. ']]'
▲ end
return {
|