אונטערשייד צווישן ווערסיעס פון "יחידה:תבנית מידע"

אפדעיט
(אפדעיט)
(אפדעיט)
 
(איין צווישנדיגע ווערסיע פונעם זעלבן באַניצער נישט געוויזן)
שורה 442: שורה 442:
wikidataOptions['seperator'] = templateParams[missingParam..'-ויקינתונים-מרובה-הפרדה']
wikidataOptions['seperator'] = templateParams[missingParam..'-ויקינתונים-מרובה-הפרדה']
wikidataOptions['sort'] = { templateParams[missingParam..'-ויקינתונים-מרובה-מיון'] } or nil
wikidataOptions['sort'] = { templateParams[missingParam..'-ויקינתונים-מרובה-מיון'] } or nil
if templateParams[missingParam..'-ויקינתונים-מרובה-מיון-יורד'] then
wikidataOptions['sort-order'] = 'desc'
end
paramsData = {}
paramsData = {}
-- split multiple params to include all of them (e.g: "P1,P2")
-- split multiple params to include all of them (e.g: "P1,P2")
שורה 470: שורה 473:
local wikidataParamValue = propertyLink.getLabel(templateParams[missingParam..'-ויקינתונים-פשוט'], entityId)
local wikidataParamValue = propertyLink.getLabel(templateParams[missingParam..'-ויקינתונים-פשוט'], entityId)
if wikidataParamValue and #wikidataParamValue>0 then
if wikidataParamValue and #wikidataParamValue>0 then
templateArg.data = frame:preprocess(mw.ustring.gsub(templateArg.data, '\{\{\{('..missingParam..')\}\}\}', wikidataParamValue))
templateArg.data = frame:preprocess(mw.ustring.gsub(templateArg.data, '{{{('..missingParam..')}}}', wikidataParamValue))
inWikidata = true
inWikidata = true
end
end
שורה 576: שורה 579:
if (templateArgs['qid'] ~= nil and templateArgs['qid'] ~= '') then
if (templateArgs['qid'] ~= nil and templateArgs['qid'] ~= '') then
args.entityId = templateArgs['qid']
args.entityId = templateArgs['qid']
elseif (templateParams['qid'] ~= nil and templateParams['qid'] ~= '') then
else
args.entityId = templateParams['qid']
args.entityId = templateParams['qid']
else
args.entityId = mw.wikibase.getEntityIdForCurrentPage()
end
end
-- disable wikidata fetching
-- disable wikidata fetching
שורה 587: שורה 588:
args.titlestyle = templateParams['כותרת תבנית-עיצוב']
args.titlestyle = templateParams['כותרת תבנית-עיצוב']
args.titleclass = templateParams['כותרת תבנית-מחלקה']
args.titleclass = templateParams['כותרת תבנית-מחלקה']
args.subtitle = templateParams['תת כותרת תבנית']
args.subtitle = templateParams['תת-כותרת תבנית']
args.subtitlestyle = templateParams['תת כותרת תבנית-עיצוב']
args.subtitlestyle = templateParams['תת-כותרת תבנית-עיצוב']
args.subtitleclass = templateParams['תת כותרת תבנית-מחלקה']
args.subtitleclass = templateParams['תת-כותרת תבנית-מחלקה']
args.rightImageDesc = templateParams['כיתוב ימין']
args.rightImageDesc = templateParams['כיתוב ימין']
שורה 595: שורה 596:
valueArg=templateParams['תמונה ימין'],
valueArg=templateParams['תמונה ימין'],
wikidataArg=templateParams['תמונה ימין-ויקינתונים'],
wikidataArg=templateParams['תמונה ימין-ויקינתונים'],
width='100x80',  
width=templateParams['תמונה ימין-גודל'] or '100x80',  
imgDesc=args.rightImageDesc,
imgDesc=args.rightImageDesc,
args=args
args=args
שורה 604: שורה 605:
valueArg=templateParams['תמונה שמאל'],
valueArg=templateParams['תמונה שמאל'],
wikidataArg=templateParams['תמונה שמאל-ויקינתונים'],
wikidataArg=templateParams['תמונה שמאל-ויקינתונים'],
width='100x80',  
width=templateParams['תמונה שמאל-גודל'] or '100x80',  
imgDesc=args.leftImageDesc,
imgDesc=args.leftImageDesc,
args=args
args=args
שורה 778: שורה 779:
else
else
-- otherwise if the template isn't full or if there is a Wikidata-beats tag - them try to use wikidata to fill it
-- otherwise if the template isn't full or if there is a Wikidata-beats tag - them try to use wikidata to fill it
local m = mw.ustring.match(v.data, '\{\{\{(.-)\}\}\}')
local m = mw.ustring.match(v.data, '{{{(.-)}}}')
if v.label and templateParams[v.label..'-ויקינתונים-גובר'] then
if v.label and templateParams[v.label..'-ויקינתונים-גובר'] then
m = templateParams[v.label..'-ויקינתונים-גובר']
m = templateParams[v.label..'-ויקינתונים-גובר']
שורה 823: שורה 824:
-- use wikidata in title
-- use wikidata in title
if args.title then
if args.title then
local m = mw.ustring.match(args.title, '\{\{\{(.-)\|?\}\}\}')  
local m = mw.ustring.match(args.title, '{{{(.-)|(?)}}}')  
if m then
if m then
local inWikidata = false
local inWikidata = false
שורה 835: שורה 836:
local wikidataParamValue = propertyLink.getLabel(templateParams[m..'-ויקינתונים-פשוט'])
local wikidataParamValue = propertyLink.getLabel(templateParams[m..'-ויקינתונים-פשוט'])
if wikidataParamValue then
if wikidataParamValue then
args.title = frame:preprocess(mw.ustring.gsub(args.title, '\{\{\{('..m..')\|?\}\}\}', wikidataParamValue))
args.title = frame:preprocess(mw.ustring.gsub(args.title, '{{{('..m..')|?}}}', wikidataParamValue))
end
end
end
end