locked
feature to add a item to action menu RRS feed

  • Question

  • HI,
    I have created a feature to show a new item to menu which has View Item, Edit Item etc.... My requirement is, this custom menu item should be displayed for a particular custom list, but not to all. this is in MOSS 2007. please let me know how should i do that?

    thanks.


    • Edited by Mike Walsh FIN Sunday, May 22, 2011 11:30 AM unnecessary part of Title (incl. - MOSS 2007) removed. MOSS 2007 is default here.
    Sunday, May 22, 2011 7:24 AM

Answers

All replies

    • Proposed as answer by V284 Thursday, May 26, 2011 1:42 AM
    • Marked as answer by David HM Monday, May 30, 2011 1:29 AM
    Sunday, May 22, 2011 8:51 AM
  • Thanks Prasath C
    Wednesday, May 25, 2011 8:37 PM
  • Prasath, I tried to implement the solutions suggested in your response, but it is not working. I am using MOSS 2007. I even tried to implement it for a content type  but the menu item is not showing up per item ECB. Please advise.
    Thursday, May 26, 2011 3:03 PM
  • Can you post your CustomAction markup?
    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Thursday, May 26, 2011 3:09 PM
  • Hi Dave,

    I have tried  two different ways.
    one is by creating a feature for list template and custom action:

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
        <ListTemplate
            Name="MyCustomList"
            Type="99099"
            BaseType="0"
            OnQuickLaunch="TRUE"
            SecurityBits="11"
            Sequence="410"
            DisplayName="My Custom List"
            Description="My Custom List"
            Image="/_layouts/images/itgen.gif"/>
    </Elements>

    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
      Id="abc.MyCustomList"
      RegistrationType="List"
      RegistrationId="99099"
      ImageUrl="/_layouts/images/GORTL.GIF"
      Location="EditControlBlock"
      Sequence="300"
      Title="Copy Item..." >
      <UrlAction Url="http://abc.com/CustomPage/Default.aspx?List={ListId}&amp;ID={ItemId}"/>
    </CustomAction>
    </Elements>

    I have placed the above code in two different element manifest files

     <ElementManifests>
        <ElementManifest Location="elements.xml"/> 
        <ElementManifest Location="caction.xml"/>   
      </ElementManifests>

     

    Other way is, by creating a content type. registration id is taken from the content type after associating it with the list:

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <CustomAction
        Id="abc.MyCustomList"
        RequireSiteAdministrator="FALSE"
            RegistrationType="ContentType"
        RegistrationId="0x0100BDB15C31E6F06C4BB6806C430D294BE800ECC54EEA76DAA0448517FE0F5A1DE44C"
        ImageUrl="/_layouts/images/GORTL.GIF"
        Location="EditControlBlock"
        Sequence="300"
        Title="Copy Item..." >
        <UrlAction Url="http://abc.com/CustomPage/Default.aspx?List={ListId}&amp;ID={ItemId}"/>
      </CustomAction>
    </Elements>

    could you please help me? thanks

    Moderator Note: One question per thread so I have deleted your next post which asked a new question. 

     

     

     



    • Edited by Mike Walsh FIN Thursday, May 26, 2011 7:37 PM Moderator Note added about deleting new question post (from OP)
    Thursday, May 26, 2011 4:18 PM