The "Users – View user" module (UserViewSettings) sorts the rendered list with
SortBy / SortOrder, and when no sort field is configured it falls back to sorting by
user ID. There is no SortBy value that keeps users in the curated order that already
exists in the chosen source:
When Source = ListOfUsersFromSpecifiedGroups, each user group already has a manually
maintained user order (the order returned by UserGroup.GetUsers(), editable in the
group's admin). That order is ignored.
When Source = ListOfChosenUsers, the editor picks and arranges specific users
(SelectedUserIds), but that arrangement is ignored.
So an editor cannot present an intentionally ordered list of people (e.g. an employee or
supplier listing shown in a deliberate sequence). The only options are field-based sorts
(Name, Email, …) or the ID fallback — none of which reflect the curated order the editor
has already set up.
It would be very helpful if you could add a new SortBy value to the UserView module — e.g. "Source / manual order" (final
label up to you) — that keeps users in the order defined by the selected Source instead
of re-sorting by a field:
Source = ListOfUsersFromSpecifiedGroups → use each group's stored user order
(UserGroup.GetUsers()). When multiple groups are selected, render group-by-group
following the selected group sequence (SelectedUserGroupIds order), and within each
group preserve that group's manual user order.
Source = ListOfChosenUsers → use the order of SelectedUserIds as arranged in the
module.
SortOrder (Ascending/Descending) should still apply on top — Descending simply reverses
the resulting curated sequence.
I have already considered:
- to reimplement the module. We maintain a custom copy of the module (a
SupplierUserViewModule built from the platform module) specifically to control ordering.
It is costly to keep in sync as the standard module evolves.
- Reordering in the template. In our list template we re-derive the group order by
calling UserGroup.GetUsers() and indexing each user by position. This only works when
exactly one group is selected, doesn't cover the chosen-users case or multiple groups,
and pushes business-ordering logic into the template.
- A numeric "sort index" custom field per user. Sorting by a hand-maintained field
duplicates information that already exists as the group/selection order and is error-prone
to keep up to date.
Relevant API: Dynamicweb.Users.Frontend.UserView.UserViewSettings
(Source, SortBy, SortOrder, SelectedUserGroupIds, SelectedUserIds),
Dynamicweb.Users.Frontend.UserView.UserViewSourceType
(ListOfUsersFromSpecifiedGroups, ListOfChosenUsers),
Dynamicweb.Users.SortOrderType (Ascending/Descending).
The group order is available via
Dynamicweb.Security.UserManagement.UserGroup.GetUsers().
DW version: 10.25.11.
The "Users – View user" module (UserViewSettings) sorts the rendered list with
SortBy / SortOrder, and when no sort field is configured it falls back to sorting by
user ID. There is no SortBy value that keeps users in the curated order that already
exists in the chosen source:
When Source = ListOfUsersFromSpecifiedGroups, each user group already has a manually
maintained user order (the order returned by UserGroup.GetUsers(), editable in the
group's admin). That order is ignored.
When Source = ListOfChosenUsers, the editor picks and arranges specific users
(SelectedUserIds), but that arrangement is ignored.
So an editor cannot present an intentionally ordered list of people (e.g. an employee or
supplier listing shown in a deliberate sequence). The only options are field-based sorts
(Name, Email, …) or the ID fallback — none of which reflect the curated order the editor
has already set up.
It would be very helpful if you could add a new SortBy value to the UserView module — e.g. "Source / manual order" (final
label up to you) — that keeps users in the order defined by the selected Source instead
of re-sorting by a field:
Source = ListOfUsersFromSpecifiedGroups → use each group's stored user order
(UserGroup.GetUsers()). When multiple groups are selected, render group-by-group
following the selected group sequence (SelectedUserGroupIds order), and within each
group preserve that group's manual user order.
Source = ListOfChosenUsers → use the order of SelectedUserIds as arranged in the
module.
SortOrder (Ascending/Descending) should still apply on top — Descending simply reverses
the resulting curated sequence.
I have already considered:
SupplierUserViewModule built from the platform module) specifically to control ordering.
It is costly to keep in sync as the standard module evolves.
calling UserGroup.GetUsers() and indexing each user by position. This only works when
exactly one group is selected, doesn't cover the chosen-users case or multiple groups,
and pushes business-ordering logic into the template.
duplicates information that already exists as the group/selection order and is error-prone
to keep up to date.
Relevant API: Dynamicweb.Users.Frontend.UserView.UserViewSettings
(Source, SortBy, SortOrder, SelectedUserGroupIds, SelectedUserIds),
Dynamicweb.Users.Frontend.UserView.UserViewSourceType
(ListOfUsersFromSpecifiedGroups, ListOfChosenUsers),
Dynamicweb.Users.SortOrderType (Ascending/Descending).
The group order is available via
Dynamicweb.Security.UserManagement.UserGroup.GetUsers().
DW version: 10.25.11.