Check how it is done in HarvestMap addon.
Lua Code:
local optionsTable = setmetatable({}, { __index = table })
optionsTable:insert({
type = "button",
name = "Import other Accounts",
tooltip = "Moves gathered data from other Accounts to this one. This can also restore lost data after an ESO update.",
warning = "Please create a backup of your data first! Copy the file SavedVariables/HarvestMap.lua to somwhere else.",
width = "half",
func = function()
Harvest.makeGlobal("nodes")
end
})
--lots of other entries
--entries added by for loop
for profession = 1, 8 do
optionsTable:insert({
type = "header",
name = Harvest.localization[ "filter"..profession ] .. " pin Options",
})
CreateFilter( profession )
CreateImportFilter( profession )
CreateGatherFilter( profession )
CreateSizeSlider( profession )
CreateColorPicker( profession )
end
--rest of the entries