Krlos Posted August 26, 2018 Share Posted August 26, 2018 Hello, I'm trying to create a front end search from custom fields stored in the user system template. For example I've created a custom field "last_name", what selector can I use to find all the users with "smith" last name in my users table? and how how to combine search terms?, for example to match a search for last name "smith" that have a status of married (married also a custom field in the user template) Thank you Link to comment Share on other sites More sharing options...
dragan Posted August 26, 2018 Share Posted August 26, 2018 $u = $users->find("last_name=Smith"); foreach($u as $uu) { echo "{$uu->first_name} {$uu->last_name}<br>"; } // combine: (marital_status is a page-reference field in my test setup) $u = $users->find("marital_status=divorced, last_name=Smith"); foreach($u as $uu) { echo "{$uu->first_name} {$uu->last_name}, {$uu->marital_status->title} <br>"; } 4 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now