If this has been answered then apologies for the repeat, but I don't exactly know the right search to try find an answer. I've got to my solution about a third of the way, but for stuck when defining two contextual filters.

What I'm trying to achieve is to, using a view, select a role and a user. What would display a one line report to which I can have a link to edit the profile selected. Unless there is an easier way to find one user account within hundreds.

Anyway, if I give examples then it may be clearer.

1. http://www.example.com/acme/view1/client/jsmith
2. http://www.example.com/acme/view1/staff/another
3. http://www.example.com/acme/view1/client/all
4. http://www.example.com/acme/view1/staff/all

So, it's filtering to two levels that I'm after. First should select jsmith what has a client role, second selects another that has staff role, 3 selects all users that have the client role and the fourth selects all users that have a staff role.

Can anyone guide me how to do this within a view. I've been trying to find easy-read examples and been struggling for a number of hours and currently have thrown in the towel. It's not clear to me at all how to make this work.

I can get a contextual filter to work with only one context filter to work.

Can anyone please help and explain in a way I'll hopefully will be able to follow?

Comments

nevets’s picture

I suspect part of the issue is the role contextual filter expects a role id (a number) and not name.

That said, this seems to be something to use Filter Criteria for (instead of contextual filter).

Add a filter on "User: Roles" and make sure to check "Expose this filter to visitors, to allow them to change it"
Now add another filter on "User: Name" also check "Expose this ...".

Now you have to visible filters you can filter the view by, one on role, the other on user name. This allows you to more easily find users or a user without the need to construct a path.