Module:List: Difference between revisions
Jump to navigation
Jump to search
m>Mr. Stradivarius Undid revision 581617993 by Mr. Stradivarius (talk) actually, this is no longer necessary due to changes in Module:Random |
m>Frietjes optional item_valueX for Brigadoon (The Ancestors album) |
||
Line 6: | Line 6: | ||
local htmlBuilder = require('Module:HtmlBuilder') | local htmlBuilder = require('Module:HtmlBuilder') | ||
local function getListItem(data, style, itemStyle) | local function getListItem(data, style, itemStyle, itemValue) | ||
if not data then | if not data then | ||
return nil | return nil | ||
Line 15: | Line 15: | ||
.cssText(itemStyle) | .cssText(itemStyle) | ||
.wikitext(data) | .wikitext(data) | ||
if(itemValue) then | |||
item.attr(value,itemValue) | |||
end | |||
return tostring(item) | return tostring(item) | ||
end | end | ||
Line 43: | Line 46: | ||
args[num], | args[num], | ||
args.item_style or args.li_style, -- li_style is included for backwards compatibility. item_style was included to be easier to understand for non-coders. | args.item_style or args.li_style, -- li_style is included for backwards compatibility. item_style was included to be easier to understand for non-coders. | ||
args['item_style' .. tostring(num)] or args['li_style' .. tostring(num)] | args['item_style' .. tostring(num)] or args['li_style' .. tostring(num)], | ||
args['item_value' .. tostring(num)] | |||
) | ) | ||
table.insert(listItems, item) | table.insert(listItems, item) |