Module:Item

function Item.GalleryCharacters(frame) local args = getArgs(frame, { parentOnly = true }) local out = {} local name = args['name'] or pagetitle table.insert(out,        (args['image/V3'] or name..' V3.png') ..        '|Volume 3'    ) if args['image/V3_alternative_label'] and args['image/V3_alternative'] then table.insert(out, args['image/V3_alternative']..'|'..args['image/V3_alternative_label']) end table.insert(out,        (args['image/V2'] or name..' V2.png') ..        '|Volume 2'    ) if args['image/V2_alternative_label'] and args['image/V2_alternative'] then table.insert(out, args['image/V2_alternative']..'|'..args['image/V2_alternative_label']) end table.insert(out,        (args['image/V1'] or name..' V1.png') ..        '|Volume 1'    ) if args['image/V1_alternative_label'] and args['image/V1_alternative'] then table.insert(out, args['image/V1_alternative']..'|'..args['image/V1_alternative_label']) end table.insert(out,        (args['image/chathead'] or name..' chathead.png') ..        '|Chathead'    ) return table.concat(out,'\n') end function Item.version_label(frame) local version = getArgs(frame, { frameOnly = true })[1] or nil local args = getArgs(frame, { parentOnly = true }) local name = version and args['name'..version] local name_backref = name and name:match('^%$%d+$') name_backref = name_backref and name_backref:gsub('%$','') name = name_backref and (args['name'..name_backref] or args['name'..(version or '')]) local ver = version and args['version'..version] return name or ver or 'Typical' end