I am trying to add a ribbon custom action to a custom list that is created from a custom list template. The list template itself is based on Asset Library. The code below successfully adds the ribbon action to ALL asset libraries, but I want the ribbon action only to show up on my custom lists created from the templates.
I'm assuming that the solution has something to do with editing the manifest.xml that is associated with the list template .stp file, but if I edit the TemplateType to be anything other than 851 (Asset Library) I no longer see the list template in the apps to add in my site.
I will also add that I do not have access to the SharePoint farm itself, so my solution must only include client-side code or code that the app can install.
UserCustomAction customAction = clientContext.Web.UserCustomActions.Add(); customAction.Url = "http://www.bing.com"; customAction.RegistrationId = "851"; customAction.RegistrationType = UserCustomActionRegistrationType.List; customAction.Location = "CommandUI.Ribbon.ListView"; customAction.Title = "Ribbon Button"; customAction.Description = "Ribbon Button Description"; customAction.CommandUIExtension = @"<CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location=""Ribbon.Documents.New.Controls._children""> <Button Id=""RibbonButton.Button"" TemplateAlias=""o1"" Command=""RibbonButton"" CommandType=""General"" LabelText=""Ribbon Button"" /> </CommandUIDefinition> </CommandUIDefinitions> <CommandUIHandlers> <CommandUIHandler Command =""RibbonButton"" CommandAction=""http://www.bing.com"" /> </CommandUIHandlers> </CommandUIExtension>"; customAction.Update(); clientContext.ExecuteQuery();