Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Here is the xml from element file. It's scope to web.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="HelloWorld"
                Title="Hello World"
                Location="CommandUI.Ribbon"
                RegistrationType="List"
                RegistrationId="101">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Documents.Manage.Controls._children">
          <Button Id="Ribbon.HelloWorld"
                  TemplateAlias="o1"
                  Command="HelloWorld"
                  LabelText="Hello world"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="HelloWorld"
                          CommandAction="javascript:alert('Hello world from ribbon !');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>
share|improve this question
    
to be clear, and I'm no great ribbon expert, are you trying see the ribbon in the context of the default custom list, i.e. you have the all items form for a generic custom list open when you look for your button? Because it looks like you're registering the button for that type of list and not as a global button. –  GavinB Dec 6 '11 at 22:01
add comment

2 Answers 2

The following is the corrected code and is working now. Make sure to copy the image "copy_item.png" (http://www.iconfinder.com/icondetails/11062/32/copy_document_icon) to images folder (under 14 hive).

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
   Id="CustomRibbon"
   Location="CommandUI.Ribbon"
   RegistrationId="101"
   RegistrationType="List"
   Title="Copy Item to Doc Lib">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
         Location="Ribbon.Documents.Manage.Controls._children">
          <Button
           Id="Ribbon.Items.Manage.CustomRibbon"           
           Command="CopyItem"
           Image32by32="/_layouts/images/copy_item.png"
           LabelText="Copy Item"
           TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="CopyItem" CommandAction="javascript:alert('Hello world!');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>
share|improve this answer
    
So... the only problem was that you weren't seeing an image? –  Paul Lucas Dec 7 '11 at 22:44
add comment

The code provided works fine on my machine.

  1. Double check that the feature is activated on the web
  2. The button (as currently defined) will show up only on the list view page of a standard document library
share|improve this answer
add comment

Your Answer

 
discard

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.