יחידה:תבנית מידע: הבדלים בין גרסאות בדף
מ הוספת כיתוב מפרמטר לתחביר קובץ סטנדרטי |
ביטול דריסה של defaulא ותיעוד של removeFirstHeader + התייחסות לתמונות ימין ושמאל |
||
| שורה 222: | שורה 222: | ||
function Infobox:removeEmptyHeaders() | function Infobox:removeEmptyHeaders() | ||
local lastHeaderIndex=nil | local lastHeaderIndex=nil | ||
local | |||
if self.args.removeFirstHeader~=nil then | local hasImage = (self.args.image~=nil and #self.args.image>0) | ||
hasImage = hasImage or (self.args.rightImage~=nil and #self.args.rightImage>0) | |||
hasImage = hasImage or (self.args.leftImage~=nil and #self.args.leftImage>0) | |||
local removeFirstHeader = (not hasImage) -- remove the first header if there are no images | |||
if self.args.removeFirstHeader~=nil then --override the default by explicit parameter | |||
removeFirstHeader=self.args.removeFirstHeader | removeFirstHeader=self.args.removeFirstHeader | ||
end | end | ||
| שורה 602: | שורה 607: | ||
args=args | args=args | ||
} | } | ||
args.removeFirstHeader = | |||
args.removeFirstHeader = nil -- default | |||
-- explictly override the default | |||
if templateParams['כותרת כללית'] == 'כן' then | if templateParams['כותרת כללית'] == 'כן' then | ||
args.removeFirstHeader = true | args.removeFirstHeader = true | ||