0

I need to add a new action button in the Site Actions menu for my site.

If I do this without a custom WebControl, it works, using an Element.xml file. However, I cannot get this to work with a WebControl, as I need to place it just above the New Page item.

My Elements.xml file

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="BlueRing.SharePoint.NewProject"
    Location="Microsoft.SharePoint.StandardMenu"
    GroupId="SiteActions"
    Rights="ManageSubwebs"
    ControlAssembly="$SharePoint.Project.AssemblyFullName$"
    ControlClass="BlueRing.SharePoint.NewProject">    
  </CustomAction>
</Elements>

My WebControl class

namespace BlueRing.SharePoint
{
    public class NewProject
        : WebControl
    {
        protected override void CreateChildControls()
        {
            MenuItemTemplate item = new MenuItemTemplate();
            item.Text = "New Project";
            item.Description = "Creates a new Project site";
            item.ImageUrl = "/_layouts/images/BlueRing/projecticon.png";
            item.MenuGroupId = 200;
            item.Sequence = 201;
            item.ClientOnClickScript = "removed for legibility";
            this.Controls.Add(item);
        }
    }
}

When I deploy my feature and activate it, the menu item is not visible. I followed this example to the T, but still nothing.

0

Resolved this, must be deployed via a Module and not a blank Elements.xml file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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