Great Idea !

This discussion is related to the Module Sort addon.
vrijvlindervrijvlinder Papillon-Sauvage MVP

This is a great idea and very useful. It will surely cut down on questions such as "How to sort my modules ?"

I wonder though, since I do have some modules I made myself, how to include them in the array of modules, and also If I already am using the config to sort them, will this supersede my config ?

peregrineBleistivtShadowdarehgtonight

Comments

  • Yes, the plugin basically just provides an easier way to write the sort array to your config.

    Vanilla sorts modules in the panel like this:

    1) The ModuleSortContainer property of the controller is checked. If it is false, nothing will be sorted, if it is a non-empty string and there is a config entry for Modules.{ModuleSortContainer}.Panel, this will be used for sorting.

    I have chosen to omit this for the plugin, because it is not used in the core. (The profile controller calls its ModuleSortContainer Profile, but it doesn't appear in the config-defaults, so Dashboard applies.) Using the name of another application however will work.

    2) All Modules with class names that match what is in Modules.{ApplicationName}.Panel are added to the panel in that order.

    3) All the other modules are added to the panel in the order they were added.

    So, if you have this sort order defined:
    [B, C, D, E]
    and modules:
    [A, C, B]
    they will appear in this order:
    [B, C, A]

    I wrote "modules" and "panel", but this is also true for all assets and asset containers (the plugin only supports the panel because this is the only one you usually want to sort).

    Now there is also a difference between version 2.1 and the upcoming 2.2, which is that in 2.1 arrays in the conf.php will always be merged with the config-defaults.php, which leads to "removed" items reappering at the end of the list.

    This doesn't really matter, since you probably want to explicitly sort these anyway.

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    • Vanilla APP » Learn more «
    • iOS & Android App for Vanilla - White label app for your forum
    Shadowdareperegrinehgtonight
  • hgtonighthgtonight ∞ · New Moderator

    Ah yes.

    Thanks @Bleistivt :)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.