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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.