Skip to content

[5.2] Consistency: Users (front-end) - Front-end Overview + Single User view #43614

@pe7er

Description

@pe7er

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions