SharePoint Development Bookmark and Share   
 index > SharePoint - Development and Programming > Custom item menu for content type
 

Custom item menu for content type

Hi,

how can I add custom menu for item in list / library, but only for concrete content type?

I can add this menu as feature only for whole list (for all items in list).

Thank you,

John.

JohnH_  Friday, October 26, 2007 6:25 AM

You can do this also by a feature. Change the RegistrationType from List to ContentType and provide the id for the content type as the RegistrationId.

See example:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomAction
Id="MyNamespace.ECBItemToolbar"
RegistrationType="ContentType"
RegistrationId="0x0101000DF914AE56DC48018F862BCC4B9AE758"
Location="EditControlBlock"
Sequence="1000"
Title="MyTitle">
<UrlAction Url="MyUrl.aspx"/>
</CustomAction>

</Elements>

Best regards

Elin

ElinK  Friday, October 26, 2007 6:55 AM

You can do this also by a feature. Change the RegistrationType from List to ContentType and provide the id for the content type as the RegistrationId.

See example:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomAction
Id="MyNamespace.ECBItemToolbar"
RegistrationType="ContentType"
RegistrationId="0x0101000DF914AE56DC48018F862BCC4B9AE758"
Location="EditControlBlock"
Sequence="1000"
Title="MyTitle">
<UrlAction Url="MyUrl.aspx"/>
</CustomAction>

</Elements>

Best regards

Elin

ElinK  Friday, October 26, 2007 6:55 AM

Hi,

wow, it was so easy SmileThank you for answer.But I have other problem, which isindirectly related to this.

When I add this contextmenu to content type, I see it in standardlist view web part. But I want to see this action menu also if I use XSLT list view. My view was converted to XSLT transformation. Does anybody know, how can I add this custom action there?

Thanks,

John.

JohnH_  Friday, October 26, 2007 9:33 AM
ElinK wrote:

You can do this also by a feature. Change the RegistrationType from List to ContentType and provide the id for the content type as the RegistrationId.

See example:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomAction
Id="MyNamespace.ECBItemToolbar"
RegistrationType="ContentType"
RegistrationId="0x0101000DF914AE56DC48018F862BCC4B9AE758"
Location="EditControlBlock"
Sequence="1000"
Title="MyTitle">
<UrlAction Url="MyUrl.aspx"/>
</CustomAction>

</Elements>

Best regards

Elin

I would like to add a new custom action in the items dropdown menu for specific file extension only, for example, for the .xml files. And if I use dropdown menu for .doc files I wouldn't like to see the custom actions. Is there any way to do it for .xml, .xsn and other file types? I've tried to use following code

<!-- Per Item Dropdown (ECB) Link -->

<CustomAction Id="ApplicationPage4.ECBItemMenu"

RegistrationType="ContentType"

RegistrationId="0x010101"

ImageUrl="/_layouts/images/GORTL.GIF"

Location="EditControlBlock"

Sequence="240"

Title="View in HTML" >

<UrlAction Url="~site/_layouts/CustomApplicationPages/View.aspx?ItemId={ItemId}&amp;ListId={ListId}"/>

</CustomAction>

The RegistrationId for xml file I've taken from http://msdn2.microsoft.com/en-us/library/ms452896.aspx

But It's wrong.

Best regards,

Alexey

Alexeych  Monday, February 11, 2008 4:39 PM

You can use google to search for other answers

Custom Search

More Threads

• I would like to insert and auto fill a list form from within PowerBuilder
• 4 Week Rolling Calendar?
• How to trigger a browsrer refresh (F5) in a custom webpart
• WebService QueryEx and the query sintax
• How to add SPAlertTempate object into SPAlertTemplateCollection
• Dsabling the checkout event...
• WSP with multiple fieldtypes, webparts, event receivers question...
• Sharepoint Data Strategy
• Web-Services WSS and Delphi-client
• WSS 3.0 Tools: Visual Studio 2005 Extensions, Version 1.1 on Win2k3 64bit