Custom Download from Sitecore User Manager

I had a requirement on a recent project to download a .CSV from within Sitecore User Manager. Basically, it was to download all users within a particular domain. The ‘download’ bit proved tricky, though. Continue reading “Custom Download from Sitecore User Manager”

Advertisements
Custom Download from Sitecore User Manager

Adding a button to the User Manager

A quick shout out to this page – Adding Options to Sitecore Applications by Alistair Deneys . It’s a nice guide about how to do exactly that – add options to the menus in Sitecore. It was pretty straight forward to do for the User Manager:

  • Add an entry in the Core database to represent the button
  • Add a patch file that defines your command and what class it should call
  • Add a class file that defines the command in a child of Sitecore.Shell.Framework.Commands.Command . Override and implement Execute

The parameters to the Execute method contains which usernames have been selected. This is as a pipe separated list:

public override void Execute(CommandContext context)
{
string usernamesParameter = context.Parameters["username"];
string[] usernames = null;
if (!string.IsNullOrEmpty(usernamesParameter))
{
char[] splitter = {'|' };
usernames = usernamesParameter.Split(splitter, StringSplitOptions.RemoveEmptyEntries);
}

That might help.

Adding a button to the User Manager