Display role

Component ID

2767691

Component name

Display role

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

594

Component created

Component changed

Component body

Easily show users' assigned role or roles on their profile pages by using this module.

It makes a list of user roles available for site administrators to choose to show as one of the display fields available on user profiles.

Enable the module and go to People » Account settings » Manage display and drag "Roles" to where you would like it to display relative to the order of other items, like "Picture" and "Member for", available on this form that, as it explains, "lets administrators configure how fields should be displayed when rendering a user profile page."

User roles are therefore also available in the user profile template (user.html.twig) without having to write a preprocess function in the theme or a module.

Right now it displays a list of all roles that user has but it can and probably should be made more configurable.

This is a Drupal 8 only module with no plans to backport (it shouldn't be hard, though; volunteers always welcome).