Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve order of backend modules #1706

Closed
dmolineus opened this issue May 6, 2020 · 11 comments
Closed

Improve order of backend modules #1706

dmolineus opened this issue May 6, 2020 · 11 comments
Assignees
Labels
feature help wanted Issues and PRs which are looking for volunteers to complete them.

Comments

@dmolineus
Copy link
Contributor

I know that the issue was dicussed before (#1205, #1324), I'd like to raise awareness for this issue again. Right know backend modules are ordered by label alphabetically.

The current approach have some issues:

  • The order of modules initially set by the developer is ignored. More important may be more behind
  • The order changes when a user switches the language.

To increase UX/DX I'd like to suppose a new priority key for backend menu entries which are used to sort entries. Implementing a custom event listener to fix the order wouldn't be neccessary anymore.

If you agree with the proposed solution I'd happy to provide a PR for it.

@m-vo
Copy link
Member

m-vo commented May 6, 2020

Yes, that's something that had bothered me as well. Not sure if priorities solve the issue though.

@ausi
Copy link
Member

ausi commented May 6, 2020

How about a sorting option in the user and user group settings? This would make sense IMO because how important a backend module is might depend on the user (group).

@dmolineus
Copy link
Contributor Author

dmolineus commented May 7, 2020

Yes, that's something that had bothered me as well. Not sure if priorities solve the issue though.

There would be probably some edge cases there it doesn't fit but then you still have the event.

How about a sorting option in the user and user group settings? This would make sense IMO because how important a backend module is might depend on the user (group).

Great idea to allow a user to customize the order. However I still think it would be an improvement to allow developers to predefine an order.

Examples:

  • Contao is a page based CMS, so for most users having articles on the first place sounds reasonable (Of course for editors only responsible for news the customized order perfectly makes sense)
  • The page structure is probably used more often than templates or theme
  • The file management is probably used more often than the recover

These are examples based already existing in the core. In custom extensions I have some extra use cases:

  • An about module which provides information about documentation, license etc
  • Logical order between modules where usually data have to be set in the first one and being applied in the second one

In summary I vote for a predefined order but also having the ability to customize the order on user/group level.

@ausi ausi added the up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. label May 7, 2020
@mlwebworker
Copy link

Im Catalog Manager von Alexander Naumov ist das Verschieben der Reihenfolge schon möglich. Vielleicht kann man die Lösung schon nutzen.

@leofeyer
Copy link
Member

leofeyer commented May 7, 2020

As discussed in Mumble on May 7th, we want to make the menu order configurable in the user and user group settings. However, we do not want to add priority keys, because the automatic sorting is only applied to the "old" menu items coming from BackendUser::navigation() and does not affect "new" menu items which are added to the Knp menu via event listener.

@leofeyer leofeyer added feature and removed up for discussion Issues and PRs which will be discussed in our monthly Mumble calls. labels May 7, 2020
@zonky2
Copy link
Contributor

zonky2 commented May 21, 2020

With sorting by key, for example, has such "illogical" effects in MetaModels

FireShot Pro Screen Capture #041 - 'Dashboard I mm220_dev_metamodel_me' - mm

@fritzmg
Copy link
Contributor

fritzmg commented May 27, 2020

However, we do not want to add priority keys, because the automatic sorting is only applied to the "old" menu items coming from BackendUser::navigation() and does not affect "new" menu items which are added to the Knp menu via event listener.

What about entries like:

// contao/config/config.php
$GLOBALS['BE_MOD']['foobar']['foo'] = [
    'tables' => ['tl_foo']
];

i.e. back end modules for editing records of a DataContainer. Is there a new way to register those and add them via the event listener? If yes, then I am simply not aware of it or how to do it - and I need to document it 😁

If no, then we do need priority keys, so that developers can define a sensible default sorting for their modules within their own section.

@leofeyer leofeyer added the help wanted Issues and PRs which are looking for volunteers to complete them. label Jun 12, 2020
@timgatzky
Copy link

timgatzky commented Aug 6, 2020

As discussed in Mumble on May 7th, we want to make the menu order configurable in the user and user group settings. However, we do not want to add priority keys, because the automatic sorting is only applied to the "old" menu items coming from BackendUser::navigation() and does not affect "new" menu items which are added to the Knp menu via event listener.

The backend user rights could use a sortable checkboxWizard instead of the normal checkboxes to also define the positions of each module along to the access rights. The sorting can then be applied with a simpel array_insert method based on the sorting of the widget. Pretty much the way Contao did it before it changed to the strict alphabetically order (now reverted).

The array insert method is how I do it in CustomCatalog to include the backend modules at the position selected in the settings of the CC

@zonky2
Copy link
Contributor

zonky2 commented Aug 6, 2020

@timgatzky
What do we do with the admins who are not in any user group?

What happens if there are several user groups - is the first group the decisive one?

@leofeyer
Copy link
Member

leofeyer commented Aug 6, 2020

The alphabetical sorting has already been reverted (see #1919), therefore this ticket is no longer relevant.

@leofeyer leofeyer closed this as completed Aug 6, 2020
@timgatzky
Copy link

timgatzky commented Aug 6, 2020

Groups and user rights merge. Admins can be defined on user level.

Big question is. Is anybody really using or even needing this feature in the Contao core?
From the agency point of view: The backend is straight forward and easy enough to explain to new user/editors. There is no need for a custom order of the core modules. Also the whole Contao interface might vary from installation to installation.
From the programmers point of view: The reordering via BE_MOD works nicely via numeric index and array inserts. No need to change this. (thanks for the revert btw)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature help wanted Issues and PRs which are looking for volunteers to complete them.
Projects
None yet
Development

No branches or pull requests

8 participants