SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone knows how to show a custom action in the ribbon for only one list? At this moment I've got multiple custom lists, but my button is added on all of them. I only want to show it on one particular list...

(I found a simular question, but there isn't a good solution for it)

share|improve this question
up vote 17 down vote accepted

You can associate your custom action to a specific list by using the RegistrationId property.


<CustomAction ControlAssembly="MagicalProject.Actions" 
                Description="This is my custom action which does magical stuff" 
                RegistrationId="MyMagicalList" // Or whatever other identifier you have for your lists

UPDATE: It also applies for ContentTypes. So if you associate it with a contenttype, then all lists inheriting that specific contenttype will also get this custom action. In case you wanted to know how to put it on more than 1 list.

All it takes is changing RegistrationType from List to ContentType

share|improve this answer
I've used as RegistrationId the Id from the list and than it worked perfectly. Thanks! – Ruben Herman Jan 26 '12 at 9:50
Wasn't the registration id used to specifiy a list ServerTemplate id? You can associate the custom action to a specific template (es: generic list, document libray, image library ecc), but I don't think you can use the registration id to specify a string name of a list. – SPArchaeologist Jan 26 '12 at 9:58
@SPArchaeologist According to MSDN you can. I think you might be thinking about RegistrationType. – Daniel Ziga Jan 26 '12 at 10:02
@Dandroid. From my experience, the registration id is used to specify a list template id (you must also set the parameter RegistrationType to "List"). That way you can for associate your action with every list of a set template - be it Survey (102), GenericList (100), PictureLibrary (109) ecc ecc. I am not aware if you could also use a list name/url/other in place of the template id - I will test this when I get some time, for now this is a nice thing to know (that would open new way to implement things). – SPArchaeologist Jan 26 '12 at 10:19
@JohnDoDo: One more thing. I'm not sure I fully understood your situation, but if you need to add your custom action to a specific Content Type you may try to change the registration type to ContentType and set the RegistrationID to the id of your CT. – SPArchaeologist Feb 3 '12 at 8:06

I've made some research on the subject of RegistrationId and RegistrationType according to declarative Ribbon customization. All my findings can be found here:

RegistrationType & RegistrationId in SharePoint 2010 declarative Ribbon customizations

As a short summary: You can use all four registration types to target some content for Ribbon customization.

And concerning your question: There's no direct option to specify single list instance by means of registrationid. But there's a workaround; you can create an unique content type for your specific list and use RegistrationType = ContentType to target it.

Another way you can go is the programmatic Ribbon customization.

share|improve this answer

You can use EnabledScript parameter in CommandUIHandler, where you can put javascript code and check if specific page/list/view is loaded.


    function isEnable(){
      if(location.href.indexOf('AllItems.aspx') > 0){
        return true;
      return false;
share|improve this answer
beautiful hack ! – devi Jul 22 '15 at 8:59
downvoted: WRONG answer - it still be in all lists (in disabled state) – dbardakov Apr 19 at 20:31
Why in all lists? You can easily specify to which list you register the action (see other posts)(sorry, I didn't mention this). But you cannot assign action to specify view of list. So my post gives you solution how to specify on which view/page will be the action visible. – Petr Špaček Apr 26 at 6:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.