Posts

Showing posts from December, 2017

Add ribbon action and item context menu actions to site content type

Image
I haven't done this for a while and I was searching for it for a while and not getting the correct answer.  So, once I found it, I have to put the information in here just to remind myself later if I have to do it again sometime in the future. Below are functions to add ribbon action and context menu action to Document content type on the site collection level.  The actions requires edit list permission to see. For the ribbon, you'll be passing in the command for the ribbon which looks something like: private static void addRibbonActionToContentType(ClientContext clientContext, ContentType ct, string cmd, string actionName, string actionText)         {             // create the ribbon.             UserCustomAction customAction = clientContext.Site.UserCustomActions.Add();             customAction.Name = actionName;             customAction.Location = "CommandUI.Ribbon.ListView";             customAction.CommandUIExtension = cmd;             customAct