A couple of weeks back whilst on the train to London to take my ECD exam, I started to create a set of search providers to enable searching of users and groups from the EPiServer quick search bar.
Behind the scenes it’s very simple and makes use of pre existing functionality in EPiServer and the membership/role provider model.
One of the most difficult elements to solve was in creating the links which navigate to the user and group pages for editing. If you follow the direct page links the admin left menu and header links are not maintained. To overcome this, the default admin page can be loaded with a query string parameter (of customdefaultpage) which will set the address of the main frame with the page you wish to load. For Example, loading the default admin page and specifying the main frame to load the edit user screen on a SQL Membership Provider user named Adam (me!) would look like this:
Additionally, (and as you will see in the code) two extra processing steps must be taken:
- Both address need to be resolved to the correct path for your UI configuration using UriSupport.ResolveUrlFromUIBySettings.
- The URL passed as the customdefaultpage parameter must be url encoded as it too will contain a querystring.
So now after completing my ECD exam! I have finished the code and the source can be downloaded here.
So in a nutshell, the providers will:
- Enable users and groups to be searched from quick search bar
- Provide partial name searching for users and groups
- Only be available to members of Administrators and WebAdmins groups
Download, Modify and use at your leisure!