0

I want to list my "Custom Action" as the first item in the "Site Action" menu, so I thought of creating a new "Custom Action Group" and inside the group, I will add my "Custom Action" using the below code in elements.xml

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

<CustomActionGroup
  Description = "Display the Site Owner's Name, SharePoint Group and E-mail ID"
  Id = "SiteActions1"
  Location = "Microsoft.SharePoint.StandardMenu"
  Sequence = "0"
  Title = "View Site Owner(S)">
</CustomActionGroup>
<CustomAction
    Id="ViewSiteOwner"
    GroupId="SiteActions1"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="0"
    Title="View Site Owner"
    Description="Display the Site Owner's Name, SharePoint Group and E-mail ID." >
    <UrlAction Url="javascript:OpenPopUpPageWithTitle('{SiteUrl}/_Layouts/15/Common/SiteOwnerPage.aspx?IsDlg=1','RefreshOnDialogClose',600, 200,'View Site Owner')"/>
  </CustomAction>
</Elements>

But for some reason, it doesn't create custom group and the custom action, so I removed the "Custom Action Group" and created a custom action with the sequence to be "0", but SharePoint for some reason it displays as the last item in the menu,

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="ViewSiteOwner"
    GroupId="SiteActions"
    Location="Microsoft.SharePoint.StandardMenu"
    Sequence="20"
    Title="View Site Owner"
    Description="Display the Site Owner's Name, SharePoint Group and E-mail ID." >
    <UrlAction Url="javascript:OpenPopUpPageWithTitle('{SiteUrl}/_Layouts/15/Common/SiteOwnerPage.aspx?IsDlg=1','RefreshOnDialogClose',600, 200,'View Site Owner')"/>
  </CustomAction>
</Elements>

Is it a bug in SharePoint or is this how it works.?

1 Answer 1

0

I don't know if it is intended or not, but that is the way it works.

If you want to add a custom action to the site action menu on a different place then the last one. You need to follow this method. This is for sp2010.

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.