This recipe explains how to implement search forms for searching users.
This recipe is based on the Search Template Recipe. There is not that much difference to this recipe other than the form parameters – look at that page to learn how to build the user search.
Creating a Search Form
Add the following HTML code to a template for single input field search form:
A list of available content types, as shown with
<input type="hidden" name="t" value="user"> can be found in the Search Template Recipe.
Displaying User Details in the Search Results
Create a template file search-user.vm in the top level of the theme directory:
Scroll Viewport will only use the
search-user.vm template if the search is limited to users only (
&t=user). If other content types are searched, Scroll Viewport will use the
Extended User Search with the User Profile Plugin
Define Search Fields
With User Profile Plugin, you can also search profile data such as location, department, phone number etc. (The built-in Confluence search only searches name, email, and full name.)
To add additional search fields, add the following HTML code to a template to define the search form:
fields parameter – this specifies which Scroll Viewport should look for.
Check out how to Display Extended User Details from the User Profile Plugin.