יחידה:תבנית מידע: הבדלים בין גרסאות בדף
מ תיעוד קוד, הסתרת כותרות מיותרות |
מאין תקציר עריכה |
||
| שורה 241: | שורה 241: | ||
-- template isn't full - try to use wikidata to fill it | -- template isn't full - try to use wikidata to fill it | ||
if m then | if m then | ||
local inWikidata = false | |||
if templateParams[m..'-ויקינתונים'] then | if templateParams[m..'-ויקינתונים'] then | ||
v.data = propertyLink.getProperty(templateParams[m..'-ויקינתונים']) or nil | v.data = propertyLink.getProperty(templateParams[m..'-ויקינתונים']) or nil | ||
inWikidata = v.data | |||
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 | ||
| שורה 249: | שורה 250: | ||
if wikidataParamValue then | if wikidataParamValue then | ||
v.data = frame:preprocess(mw.ustring.gsub(v.data, '\{\{\{('..m..')\}\}\}', wikidataParamValue)) | v.data = frame:preprocess(mw.ustring.gsub(v.data, '\{\{\{('..m..')\}\}\}', wikidataParamValue)) | ||
inWikidata = true | |||
end | end | ||
end | end | ||
-- if data isn't available remove it | -- if data isn't available remove it | ||
if | if inWikidata then | ||
args.usingWikidata = true | |||
else | |||
templateStructure[k]=nil | templateStructure[k]=nil | ||
end | end | ||