יחידה:Sister project links – הבדלי גרסאות

הסרת wikibase
תגית: שוחזרה
מ שוחזר מעריכה של יהודה (שיחה) לעריכה האחרונה של [[User:imported>Euro know|imported>Euro know]]
 
שורה 85: שורה 85:
local title = mw.title.getCurrentTitle().text
local title = mw.title.getCurrentTitle().text
local projectLinks = {}
local projectLinks = {}
local entity = nil
local entity = mw.wikibase.getEntityIdForCurrentPage()
if not mw.wikibase then
entity = nil
else
entity = mw.wikibase.getEntityIdForCurrentPage()
end
 
if args['ויקיפדיה'] then
if args['ויקיפדיה'] then
local t = projectsTemplate['wikipedia']
local t = projectsTemplate['wikipedia']
שורה 159: שורה 154:
if entity~=nil and (not args[proj['arg']] or args[proj['arg']]==nil) and proj['name'] then
if entity~=nil and (not args[proj['arg']] or args[proj['arg']]==nil) and proj['name'] then
if proj['name'] == 'commons' then
if proj['name'] == 'commons' then
local commonCat = nil
local commonCat = mw.wikibase.getBestStatements( entity, 'P373' )
 
if not mw.wikibase then
commonCat = nil
else
commonCat = mw.wikibase.getBestStatements( entity, 'P373' )
end
 
commonCat = commonCat and commonCat[1] and commonCat[1].mainsnak and commonCat[1].mainsnak.datavalue and commonCat[1].mainsnak.datavalue.value
commonCat = commonCat and commonCat[1] and commonCat[1].mainsnak and commonCat[1].mainsnak.datavalue and commonCat[1].mainsnak.datavalue.value
if commonCat~=nil and commonCat~='' then
if commonCat~=nil and commonCat~='' then
שורה 174: שורה 162:
args['שם ' .. proj['arg']] = title
args['שם ' .. proj['arg']] = title
else
else
if not mw.wikibase then
args[proj['arg']] = mw.wikibase.sitelink(entity, proj['name'])
args[proj['arg']] = 'יחידה:Sister project links:177 --- שגיאה'
else
args[proj['arg']] = mw.wikibase.sitelink(entity, proj['name'])
end
end
end
end
end