P R
P R

Reputation: 13

How do I change order of list menu toolbar menus in SharePoint

I need to add custom menu to list menu toolbar. I wrote elements.xml as shown below:

<CustomAction
   Id="SiteActionsToolbar"
   RegistrationType="ContentType"
   RegistrationId="0x01"
   Location="ViewToolbar"
   Title="Upload"
   Sequence="0"
   Description="Upload file ti file system">
   <UrlAction Url="SitePages/UploadFile.aspx?ListId={ListId}"/>
</CustomAction>

My custom menu appears and works fine. But the requirement is set displaying order of this menu after "new" menu before "action" menu.

Is it possible to do this in sharepoint without using Javascript?

Upvotes: 1

Views: 492

Answers (1)

Ananda Prasad Bandaru
Ananda Prasad Bandaru

Reputation: 298

You need to define the location using below tags:

<CommandUIExtension><CommandUIDefinitions> <CommandUIDefinition Location="Ribbon.Documents.New.Controls._children">...

You can change the location by replacing the "New" with your section.

General entries will be "New", "Manage", "copies", "workflows"

The line Ribbon.Documents.New.Controls._children says to sharepoint in which section to place your custom button.

Upvotes: 2

Related Questions