יחידה:Sister project links: הבדלים בין גרסאות בדף
מאין תקציר עריכה |
מאין תקציר עריכה |
||
| שורה 83: | שורה 83: | ||
local args = require('Module:Arguments').getArgs(frame) | local args = require('Module:Arguments').getArgs(frame) | ||
local title = mw.title.getCurrentTitle().text | |||
local projectLinks = {} | local projectLinks = {} | ||
local entity = mw.wikibase.getEntityIdForCurrentPage() | local entity = mw.wikibase.getEntityIdForCurrentPage() | ||
| שורה 90: | שורה 90: | ||
local t = projectsTemplate['wikipedia'] | local t = projectsTemplate['wikipedia'] | ||
t['projectPrefix'] = args['ויקיפדיה'] | t['projectPrefix'] = args['ויקיפדיה'] | ||
t['pageDisplay'] = args['שם ויקיפדיה'] or | t['pageDisplay'] = args['שם ויקיפדיה'] or title | ||
table.insert(projectLinks, t) | table.insert(projectLinks, t) | ||
end | end | ||
| שורה 96: | שורה 96: | ||
local t = projectsTemplate['wikipedia'] | local t = projectsTemplate['wikipedia'] | ||
t['projectPrefix'] = args['ויקיפדיה 2'] | t['projectPrefix'] = args['ויקיפדיה 2'] | ||
t['pageDisplay'] = args['שם ויקיפדיה 2'] or | t['pageDisplay'] = args['שם ויקיפדיה 2'] or title | ||
table.insert(projectLinks, t) | table.insert(projectLinks, t) | ||
end | end | ||
| שורה 156: | שורה 156: | ||
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 | ||
args[proj['arg']] = commonCat | args[proj['arg']] = commonCat | ||
args['שם ' .. proj['arg']] = | args['שם ' .. proj['arg']] = title | ||
else | else | ||
args[proj['arg']] = mw.wikibase.sitelink(entity, proj['name']) | args[proj['arg']] = mw.wikibase.sitelink(entity, proj['name']) | ||