Order of Config Tab

I want to add config tabs under a config category, it seems to be sorting my tabs by alphabetical order at the moment. Is it possible to define custom order of the config tabs when defining them?

This is how I initialized the config category and tabs


    // This sets up the config panel (category)
    public static final ConfigCategory CONFIG_CATEGORY = new ConfigCategory(
            "category",
            "category name",
            0);

    // This sets up the config page (tab)
    public static final IConfigTab CONFIG_TAB = DefaultConfigTab.builder()
            .category(CONFIG_CATEGORY)
            .name("tab")
            .i18n("tab")
            .page(Panel.class)
            .terms("tab")
            .build();

I have tabs beign added to the same category from different module, it would be nice if it is possible to define the order (possibly through index?) of the tabs

Sorry, doesn't look like that's possible.

The ConfigCategory has a global order you're currently setting to 0 but that's it.

Does the tabs under the same config categories just get sorted alphabetically by name?

I wonder what was done here to have the tabs not following alphabetical order?

It may have something to do with the order of the List you return in GatewayModuleHook::getConfigPanels, but I also saw an explicit sort call in one place dealing with these tabs so I'm not sure exactly what's going on in the end, except for that the System "Overview" tab definitely has special treatment.

edit: yeah, it's just sorted by the tab's name (not title), with special treatment given to the System Overview. So I think you could get clever with your tab names to introduce ordering while the title that gets displayed remains sane.

2 Likes

Perfect thank you!