Filter Users by Attribute
Permalink
Hello.
Would somebody be able to give me pointers on the best v8 way to get a list of users, according to their User Attributes, selectable by the front end browser. Possibly using Ajax to refresh the view
I.e. Display a select attribute. Allow a 'browser' to make a choice (maybe choices) and then display a list of users who match the chosen attributes.
Big ask I know, but where to start?
Thanks.
Would somebody be able to give me pointers on the best v8 way to get a list of users, according to their User Attributes, selectable by the front end browser. Possibly using Ajax to refresh the view
I.e. Display a select attribute. Allow a 'browser' to make a choice (maybe choices) and then display a list of users who match the chosen attributes.
Big ask I know, but where to start?
Thanks.
Have a look at the file concrete\src\User\UserList.php
That class helps you get user lists and filter the list by several user related items
You will also see that the class extends another class DatabaseItemList which also contains functions you will need like filterByAttribute()
And last but not least, you should have a look at @mlocati's tutorial on item lists which might help you some wrapping your head around all this. You can find it here:https://documentation.concrete5.org/tutorials/item-lists...
As for doing all this using Ajax, once you figure out how to do what you want without Ajax, it's just a matter of plugging Ajax into that.