Feature No Code Attached Yet
avatar pe7er
pe7er
4 Jun 2024

Joomla is used for all kinds of websites. It is also great for magazine websites with articles and authors, association websites with members, portals with users, etc. However, currently in the Joomla front-end you cannot display lists of users without 3rd party extensions.

We would like to have:

  • a front-end model and a view to display a list of users
  • a front-end model and a view to display an individual user

In a lot of cases you could create a template override, add some code to get data from a model. In case of com_users you cannot use the back-end model in the front-end. To access the com_users back-end model you'll need some authentication so that only works for registered users who are logged in. Therefore we would like to include front-end models in com_users.

Some years ago I created a PR for this for Joomla 4 which was closed.
Maybe some parts of the code can be re-used: #25030

The following are guidelines for what we would like to see in a front-end Users Overview and Single User View for com_users.

Users Overview

  • Because of security and privacy, a list of users should only be displayed when it has a published menu item. To display a list of Authors, you'll need to create a menu item like "Contributors" (alias "contributors"). The internal like might be something like /index.php?option=com_users&view=users&id=3 (the author group has id: 3). The link that should work would be example.com/contributors
  • If there's no Menu Item created to display a list of Super Users, then /index.php?option=com_users&view=users&id=8 (the Super Users group has id: 8) should trigger an error (404?) and not display the users.
  • It should be possible to exclude specified users from the list of users
  • Maybe some fields from the Users table should not be added to the front-end model, like password, otpKeys and API token.

Adding a menu item for Users Overview

A new "Users List" or "List Users" view should be created:
menu-item-type

The menu item edit should have an option to select one or more User Groups, and an option to exclude single users from the overview. The example below shows a multiple select option. It would be better to use the "fancy select" for both fields to make it easier to add multiple groups/users.
menu-item-edit2

Front-end view of User Overview

The front-end User Overview should display some columns with information. The columns should be configurable in the menu item. The Names of the user should link to an individual User page.
front-end-users-overview

Adding a menu item for Single User

A new "Single User" view should be created, just like the "Users List" view above. The menu item should have some options to display or hide User details (by default: hide)

Single User View

  • A single User page should only be displayed when it has a published Single User menu item, or when there's a published Users Overview menu item for its User Group.
  • I'm not sure about the best SEF for Single User pages that do not have a menu item. Using the "username" might be a security issue. Using the Name field might be not unique enough. Maybe for the time being use the UserID?
  • Users should not be displayed with links like index.php?option=com_users&view=users&id=42

front-end-single-users

In some cases, like with a magazine website, it would be nice to display all articles written by a "Contributor". For that a separate module "Content by User" can be created. That way the Single User page can be a sort of place holder for other (3rd party) modules that are specific for that user.

avatar pe7er pe7er - open - 4 Jun 2024
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jun 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Jun 2024
avatar pe7er pe7er - change - 4 Jun 2024
The description was changed
avatar pe7er pe7er - edited - 4 Jun 2024
avatar pe7er pe7er - change - 4 Jun 2024
The description was changed
avatar pe7er pe7er - edited - 4 Jun 2024
avatar pe7er pe7er - change - 4 Jun 2024
The description was changed
avatar pe7er pe7er - edited - 4 Jun 2024
avatar richard67 richard67 - change - 4 Jun 2024
Labels Added: Feature
avatar richard67 richard67 - labeled - 4 Jun 2024
avatar brianteeman
brianteeman - comment - 8 Jun 2024

Wouldnt this be the same as using the existing contact creator plugin and then displaying a list of contacts#?

avatar brianteeman
brianteeman - comment - 8 Jun 2024

Also pretty sure that displaying a list of individual users to exclude will be a massive performance issue on a site with a lot of users. We've seen that before for relatively small lists such as when we tried to display a select list of all folders in the media plugins

avatar pe7er
pe7er - comment - 8 Jun 2024

Wouldnt this be the same as using the existing contact creator plugin and then displaying a list of contacts#?

No, I know the contract creator plugin.
And the contract creator plugin workaround is not what we want:

  • It duplicates data from the Users table into the Contacts table, which is unnecessary overhead
  • It does not keep the Contacts table in sync with the Users table.
  • Furthermore we don’t need the contact form functionality of com_contacts, nor all those fixed contact fields.

Instead, we want to create views using the existing data (no duplicates)
and make these views more flexible by making it possible to display the Custom Fields currently already available in Users.

avatar pe7er
pe7er - comment - 8 Jun 2024

Also pretty sure that displaying a list of individual users to exclude will be a massive performance issue on a site with a lot of users. We've seen that before for relatively small lists such as when we tried to display a select list of all folders in the media plugins

True!
We could consider a different approach: Instead of displaying a massive list of users, we could add functionality to com_users that allows us to display or hide individual users. And in the new front-end view in com_users we would only display users who aren't set to hidden. That way we could avoid those performance issues.

avatar brianteeman
brianteeman - comment - 8 Jun 2024

Looking at the previous PR (which I never understood why you closed it) I see a reference to an RFC you also created - in that RFC it says it was being taken to the production dept for a decision. joomla/rfc#19 (comment) Was that ever done?

avatar brianteeman
brianteeman - comment - 8 Jun 2024

As for the exclusions I would do this by usergroup not by user. For example on one of my sites I have two parallel usergroups "public members" and "private members"

Add a Comment

Login with GitHub to post a comment