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

מאין תקציר עריכה
מאין תקציר עריכה
שורה 191: שורה 191:
if m then
if m then
if templateParams[m..'-ויקינתונים'] then
if templateParams[m..'-ויקינתונים'] then
v.data = propertyLink.getProperty(templateParams[m..'-ויקינתונים'])
v.data = propertyLink.getProperty(templateParams[m..'-ויקינתונים']) or nil
args.usingWikidata = 1
args.usingWikidata = 1
elseif templateParams[m..'-ויקינתונים-פשוט'] then
elseif templateParams[m..'-ויקינתונים-פשוט'] then
-- use data should be taken from wikidata and link must not be added
-- use data should be taken from wikidata and link must not be added
v.data = mw.html.create('span'):wikitext(mw.ustring.gsub(v.data, '\{\{\{('..m..')\}\}\}', propertyLink.getLabel(templateParams[m..'-ויקינתונים-פשוט'])))
local wikidataParamValue = propertyLink.getLabel(templateParams[m..'-ויקינתונים-פשוט'])
args.usingWikidata = 1
if wikidataParamValue then
local paramWithWikidata = mw.ustring.gsub(v.data, '\{\{\{('..m..')\}\}\}', wikidataParamValue)
v.data = frame:preprocess()
args.usingWikidata = 1
else
v.data=nil
end
else
else
-- if data isn't available remove it
-- if data isn't available remove it