I have a number of registered users on my drupal 8 website who some of them are "active" and the others are "blocked".
I want to add a select list field inside the article content type displaying only user with the status= active (Easy job!)
Note: I have added a field to the user page (field_full_name) and I want to display the users using their "Full Name" and not their "Usernames". (Still an easy Job!)
So I did the below:
Create a new view to show "users"
Create an "entity reference" display for the view.
Delete the "username" field created by default
Add the Full name field to the view (field_full_name)
Add the filter field "User: User status (= Yes)"
Inside the Settings of the "Entity Reference" View, check the "User: Full Name" as the search field.
Save the view.
Add the view as a user reference field to the article content type by selecting the Reference method: Views: Filter by a entity reference view and for the View used to select the entities: Select the created view above.
Now, when you add a new article /node/add/article, if you try to select a user from the dropdown select list, you will notice that all users are displayed using their usernames and not their Full Names.
In other words, I like to have something like this in the select list:
Full Name 1.
Full Name 2.
Full Name 3.
Full Name 4.
but actually I am receiving this:
Username 1.
Username 2.
Username 3.
Username 4.
Also I noticed the same behaviour when I tried to create an "entity reference" view displaying all the groups that the current logged in user is a member of, by doing the below steps:
Create a new view and set the view to show: "Group content" of type: "All".
Add relationship: "The group containing the entity".
Add relationship: "Relates to the user entity that the group content represents".
Add a contextual filter: "User ID" and when the filter value is not available select: "User ID from logged in user"
Delete any available field created by default.
Add the field: "Title" (to show the title of the group)
Create an "entity reference" display for the view.
Inside the Settings of the "Entity Reference" View, check the "Group: Title" as the search field.
Now, add this view as an "entity reference" field to any content type for example "Article" and when you will add a new article /node/add/article, if you try to select a Group from the dropdown select list, you will notice also that all Groups are displayed using the username of the current logged in user and not by their Group titles.
In other words, lets say the current looged in username "Admin1" is a member of 3 groups titled: (Group Title 1, Group Title 2 and Group Title 3)
you will see that the entity reference select list field is displaying:
Admin1
Admin1
Admin1
Instead of:
Group Title 1
Group Title 2
Group Title 3
What am i doing wrong ?!
Is there something wrong with the "entity reference view" display ?!
any help ?
It is worth mentioning that if you just duplicate the "Entity reference" display to a "page" display and you visit that page, you will indeed see a list of users displayed using their Full Name or list of Groups displayed using their group titles
Thank you in advance,