1

I attempted to create my first Custom Ribbon action to allow users to sort list items. But I failed miserably. the Action wont show in my ribbon at all and I am having trouble finding out what is wrong. I created an empty element and stuck the following code inside.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">


  <CustomAction
          Id="Ribbon.Library.Actions.AddAButton"
          Location="CommandUI.Ribbon"
          RegistrationId="10000"
          RegistrationType="List">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.List.Settings.Controls._children">
          <Button Id="Ribbon.Library.Share.NewRibbonButton"
            Command="NewRibbonButtonCommand"
            Image16by16="{SiteUrl}/_layouts/images/siteIcon.png"
            Image32by32="{SiteUrl}/_layouts/images/siteIcon.png"
            LabelText="Reorder Videos"
            TemplateAlias="o2" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="NewRibbonButtonCommand"
          CommandAction="{SiteUrl}/_layouts/Reorder.aspx?List={ListId}" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

</Elements>

3 Answers 3

1

Have a look at Chris O'Brien's samples and his excellent series of posts on developing Ribbon UI:

Samples Series first post

1
0

Title is required attribute in CustomAction.

0

I used this article to add an Order Column to my List and add the action to my content type for the list item. This is working now.

http://mpdsharepoint.blogspot.com/2012_01_01_archive.html

Next I am trying to Sort by this column in Code using Visual Studio and a CAML query. Although when Using U2U CAML Builder it wont allow this column to be picked. It is a hidden internal column. Has anyone had success doing this??

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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