views:

13

answers:

1

I am creating an Item in my dropdown to go to an application page I created. The option in the dropdown is added to the context menu for items with spesified content types. However, i seam to have hit a small snag.

<CustomAction Id="UserInterfaceCustomActions.DocumentMigrateToLocation"
RegistrationType="ContentType"
RegistrationId="0x0101"
Location="EditControlBlock"
Sequence="500"
Title="Migrate document to location">
<UrlAction Url="~sitecollection/_layouts/ContentMigrationTool.aspx?listId={ListId}&amp;ItemId={ItemId}"/>

This added an option to the menu for all Document content types (0x0101 + children). This is perfect, because I need the option on word documents. Unfortunatly I don't want the option to be on lets say a Picture content type (0x010102).

How can I have the option available for word documents (0x0101) and not on some of its children content types (Ex.: 0x010102)?

Thank you in advance,
Edouard

A: 

I'm thinking you have a couple options, given that you aren't given much flexibility when it's an ECB CustomAction:

  1. Explicitly define a CustomAction for all Document & descendant content types except for Pictures.

  2. Some kind of craziness involving creating another CustomAction, this time with a ControlAssembly/Class, which checks the content type of SPContext.Current.List, and emits JavaScript to hide all links containing the above href if it's a Picture library.

Other than that I'm afraid I'm drawing blanks

zincorp
Thank you for your response. We are now thinking of using the List RegistrationType to work around this small issue. Out of curiosity, how would I go about doing number one that you mentioned? Number two is definatly crazy, but still possible.
Edouard