יחידה:PropertyLink: הבדלים בין גרסאות בדף

מ ייצוא פונקציית getItem
ניסוי
שורה 548: שורה 548:


function getSitelinksFromQid(frame)
function getSitelinksFromQid(frame)
resTable =mw.wikibase.getEntity(string.upper(frame.args[1] ))
resTable = mw.wikibase.getEntity(string.upper(frame.args[1] ))
resTable = resTable["sitelinks"]
resTable = resTable["sitelinks"]
s= "<table>\n"
s= "<table>\n"
שורה 556: שורה 556:
end  
end  
end
end
local function createInterwikiForQid(frame)
local raw = mw.wikibase.getEntity( string.upper( frame.args[1] ) )["sitelinks"]
local interwikis = ''
for site, title in pairs(raw) do
truncated, found = string.gsub(site, 'wiki$', '')
if found then interwikis = interwikis .. '[[' .. truncated .. ':' .. title .. ']]' end
end
return interwikis
end
return s .. "</table>"
return s .. "</table>"
שורה 579: שורה 590:
     hasEntry = hasEntry,
     hasEntry = hasEntry,
     getPageEntry = getPageEntry,
     getPageEntry = getPageEntry,
     getSitelinksFromQid=getSitelinksFromQid,
     getSitelinksFromQid = getSitelinksFromQid,
    createInterwikiForQid = createInterwikiForQid,
     ['יש פריט'] = hasEntry
     ['יש פריט'] = hasEntry
}
}