יחידה:תבנית מידע: הבדלים בין גרסאות בדף
מאין תקציר עריכה |
מאין תקציר עריכה |
||
| שורה 626: | שורה 626: | ||
local hasContent = templateArgs[label_data_names] and #templateArgs[label_data_names]>0 | local hasContent = templateArgs[label_data_names] and #templateArgs[label_data_names]>0 | ||
-- + and use explicit wikidata replace the content with such if available from wikidata | -- + and use explicit wikidata replace the content with such if available from wikidata | ||
local isExplicitWikidataParam = templateParams[label_data_names..explicitWikidata] | |||
local skipContent = false | |||
if hasContent and not isExplicitWikidataParam then | |||
if hasContent then | |||
dataTemplate = templateArgs[label_data_names] | dataTemplate = templateArgs[label_data_names] | ||
else | else | ||
local isExplicitWikidataEnabled = false | |||
if isExplicitWikidataParam then | |||
isExplicitWikidataEnabled = templateArgs[label_data_names]~=nil and mw.ustring.match(templateArgs[label_data_names], '^ *+$') | |||
skipContent = not isExplicitWikidataEnabled | |||
end | |||
dataTemplate = '{{{' ..label_data_names.. '}}}' | dataTemplate = '{{{' ..label_data_names.. '}}}' | ||
end | end | ||
table.insert(templateStructure, {label=labelName, data=dataTemplate, rowstyle=templateParams[rowStylePrefix..i], rowclass=templateParams[rowStyleClassPrefix..i], datastyle=templateParams[dataPrefix..i..styleSuffix], | if not skipContent then | ||
table.insert(templateStructure, {label=labelName, data=dataTemplate, rowstyle=templateParams[rowStylePrefix..i], rowclass=templateParams[rowStyleClassPrefix..i], datastyle=templateParams[dataPrefix..i..styleSuffix], | |||
labelstyle=templateParams[labelPrefix..i..styleSuffix], indic=indic}) | labelstyle=templateParams[labelPrefix..i..styleSuffix], indic=indic}) | ||
end | |||
end | end | ||
end | end | ||