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

מאין תקציר עריכה
מאין תקציר עריכה
שורה 430: שורה 430:
end
end
end
end
end
end
-- use wikidata in title
-- use wikidata in title
local m = mw.ustring.match(args.title, '\{\{\{(.-)\|?\}\}\}')
if args.title then
if m then
local m = mw.ustring.match(args.title, '\{\{\{(.-)\|?\}\}\}')  
local inWikidata = false
if m then
if templateParams[m..'-ויקינתונים'] then
local inWikidata = false
local wikidataParamValue = propertyLink.getProperty(templateParams[m..'-ויקינתונים']) or nil
if templateParams[m..'-ויקינתונים'] then
if wikidataParamValue then
local wikidataParamValue = propertyLink.getProperty(templateParams[m..'-ויקינתונים']) or nil
args.title = wikidataParamValue
if wikidataParamValue then
end
args.title = wikidataParamValue
elseif templateParams[m..'-ויקינתונים-פשוט'] then
end
-- use data should be taken from wikidata and link must not be added
elseif templateParams[m..'-ויקינתונים-פשוט'] then
local wikidataParamValue = propertyLink.getLabel(templateParams[m..'-ויקינתונים-פשוט'])
-- use data should be taken from wikidata and link must not be added
if wikidataParamValue then
local wikidataParamValue = propertyLink.getLabel(templateParams[m..'-ויקינתונים-פשוט'])
args.title = frame:preprocess(mw.ustring.gsub(args.title, '\{\{\{('..m..')\|?\}\}\}', wikidataParamValue))
if wikidataParamValue then
args.title = frame:preprocess(mw.ustring.gsub(args.title, '\{\{\{('..m..')\|?\}\}\}', wikidataParamValue))
end
end
end
end
end