Module:CardFilters

-- Lua Template for Dynamic Character filter controls local p = {} local common = require('Module:Common') local data = mw.loadData('Module:Card/Data') local button = ' %s ' -- Get multi-select groups for Characters, Availability, Appeal Skill, Ect. function p.SelectGroups return ' '.. UniqueOptions('appealskill').. ' '..          ' '..              UniqueOptions('character').. ' '..          ' '..              UniqueOptions('availability').. ' ' end -- Return each unique value of a given field as a button option function UniqueOptions(field) local buttons = {} local unique = {} for id, charData in common.sortedPairs(data) do       local value = charData[field] if value and not unique[value] then unique[value] = true buttons[#buttons+1] = string.format(button, value, value, value) end end return table.concat(buttons) end return p