Monday, October 16, 2006

Quick Site Settings: Adding Sub Menus to Site Actions in SharePoint


This post has been moved to a new location.

12 comments:

Anonymous said...

Hi,
Great article.
I have a question somehow related to this but that needs
more functionality then just going to a new page(URL).

What I did is add a new MenuItem(CustomAction) in the edit menu for documents in a doc lib.
Now I want for this CustomAction when I click on the MenuItem to take me in
a c# code file where I can do some things to the document for which the menu was ope.
Do you have any ideas or suggestions about implementing this?
Thank you

telex said...

This works fine .. but...
I am completely unable to get this working for a "EditControlBlock" Customaction, the assembly simply isnt called.
Regardless if i build my own class or use yours.
Creating a "static" link for a ECB is easy, you can even customize the link somewhat with {ListId} etc. But getting an ECB calling the assembly seems next to impossible.

In ye old days, i did the same thing with custom_ows javascript, and i still could, but i am unable to figure out how to make a piece of javascript that would declare my Custom_AddListMenuItems function a part of a Feature, so that it would be deployed with one.

Anonymous said...

Hi,
Very useful article.
I tried this solution and it's working fine. But i'm not able to get this working for "NewMenu" customaction. Only a blank menu was showing. Do anyone know how to get this to work?

Anonymous said...

Very helpful. One bug, however. My menus were failing on SharePoint sites installed at non-root URLs.

I had to change this:

if (web1.IsRootWeb)
m_urlPrefix = "/";

to this:

m_urlPrefix = web1.url + "/";

Anonymous said...

Hi,
This article is really helpful but I couldn't download the project, it seems that it had been moved or deleted.
Could you upload it again?

Thank you.

txs8311 said...

kert,

I came across the EditControlBlock issue as well and posted about it here.

Aside from being able to trap for a postback event, if you used a second (StandardMenu) custom action, (say one that was invisible - i.e. nothing in the CreateChildControls method), you could also include a RegisterClientScriptBlock method to register code for the Custom_AddListMenuItems function if need be.

Sphinx said...

Hi. Great article.
I have a similar problem. I wont to add menu item to ActionMenu in Lists. When I trying to use your code with some changes new menu items not appear in action menu. Link to source code is invalid. Can you help and send me source code?

Anonymous said...

How about an updated Download link for the source? The current one seems to have been broken during the SharePoint Solution site upgrade.

Anonymous said...

To the guy that couldn't get this working for the new menu.
Make sure your class extends from MenuItemTemplate
And set the properties on this in OnLoad.

eg

public class Class: MenuItemTemplate
{
protected override void OnLoad(EventArgs e)
{
this.Text = "Name";
this.ID = "ID";
this.Description = "Desc";
this.ImageUrl = "/_layouts/images/FLDRNEW.GIF";
this.Sequence = 0;
this.ClientOnClickNavigateUrl =
"url";

//this.EnsureChildControls();
base.OnLoad(e);
}
}

Anonymous said...

The Binaries and Source for this post are not found. :(

Can we relink?

MOSSDeveloper said...

Hi

Do you know how to add new List settings. For instance I would like to add a flag that says this list is archive enabled and a frequency column

Anonymous said...

QUESTION: Is there any schema information that will explain what tags are allowed in the element manifest file (Elements.xml) as well as what each tag is for? MSDN has nothing on it that I've seen and I'm not sure how to construct the manifest correctly. Thanks.