4

I've a page showing the users. I wanted to categorized them, so I created roles and I'm grouping all the users according to their role. Now, I want to have a filter in the view to give the opportunity to the users to select the different types of users, example: employee, student, etc. The view will display the users according to the filter value.

How can I accomplish this?

1

Have a look at the view People (User) view, which is located at relative path /admin/structure/views/view/user_admin_people.

This view has a User role exposed filter. You only need to implement the same filter in your view.

You need to select the same filter in screenshot below. enter image description here

  • Much better! Please review my additional edit I applied, trying to further improve your answer. Feel free to further correct if needed, or just perform a rolback if you do't ike my edit at all. – Pierre.Vriens Aug 26 '17 at 15:04
  • thank you! However, I cannot replicate 100% the same filter. it seems that page has the is one of operator and my page doesn't have that option. I've is equal to. Any idea how I can replicate this? – Valentina Rodriguez Aug 28 '17 at 14:08
  • @valentina-rodriguez I've update my answer, check the screenshot attached, to replicate the filter 100%. – Abdulla Abu Zakham Aug 28 '17 at 14:33
  • Thank you so much!! Is there any way to hide the Administrator role? – Valentina Rodriguez Aug 29 '17 at 18:11
  • @valentina-rodriguez Yes you can by edit the filter and select the roles and enable the 'Limit list to selected items' option. – Abdulla Abu Zakham Aug 30 '17 at 8:36
1

In FILTER CRITERIA click Add

enter image description here

Add User: Roles and expose the filter.

enter image description here

  • Thanks for the information, But the thing is I need a filter list and I only have a text box – Valentina Rodriguez Aug 28 '17 at 14:02
  • @ValentinaRodriguez can you add to your question a screenshot of your filter settings? (like the one I have in my answer). – No Sssweat Aug 29 '17 at 7:45
  • I'm having the same issue, when I tried to show the users in another view. I cannot generate the users list. – Valentina Rodriguez Sep 14 '17 at 14:03
  • @ValentinaRodriguez you need to add relationship, something like content author. – No Sssweat Sep 14 '17 at 18:20
  • I added a relationship and I added a filter using this field. However, It's still not working. It's only showing a field, but the main problem is that the filter is not working. A username is preload by default and when I clicked on Apply is not showing any information even though I've content matching the filter. – Valentina Rodriguez Sep 18 '17 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.