Skip to main content
1 of 2
Robin Schambach
  • 19.8k
  • 1
  • 20
  • 45

I suggest you to read the docs about [relations][1]. You can search for relations by the following parameter

In its simplest form, you can pass in one of these things to it:

An AssetFileModel, CategoryModel, EntryModel, UserModel, or TagModel object

An element’s ID

An array of element objects and/or IDs

What you pass is a string or to be more specific a url

<option value="{{category.url}}">{{ category.title }}</option>

What you have to do is:

<option value="{{category.id}}">{{ category.title }}</option>

In order to find users related to a category id.

However I strongly suggest you to build your search with PHP if you are going to include multiple parameters (more categories/search terms/complex and+or bindings) it is going to be a mess with twig [1]: https://craftcms.com/docs/relations#the-relatedTo-param

Robin Schambach
  • 19.8k
  • 1
  • 20
  • 45