In SharePoint Designer 2010, if one removes one of the default forms (say "EditForm.aspx"), how does he also remove the "Edit" option from the List Item Menu? The default forms are not represented in the "Custom Actions" pane when looking at the form settings page in SharePoint Designer.
-
If you are trying to stop user from editing your list items, there may be better ways to do it. For example, if there is no write access to your list, the edit button will be disabled automatically. Does that work for you?– Ashish PatelOct 23, 2010 at 22:02
-
Thanks for the reply. Actually that is not what we are trying to accomplish. The user can edit, we just have a custom page that has additional functionality on it so I want to hide the default one.– Rob WilsonOct 23, 2010 at 23:20
2 Answers
I was going to say use HideCustomAction, but apparently it doesnt work with the EditControlBlock.
http://msdn.microsoft.com/en-us/library/ms414790.aspx
http://msdn.microsoft.com/en-us/library/bb802730.aspx
So i think you have to hide it with javascript
http://techtrainingnotes.blogspot.com/2008/02/sharepoint-hiding-menus-not-using.html
Or you can hack some system javascript files (and put your sharepoint into an unsupported state) and get HideCustomAction to work.
If you know the text content of the item, you could remove it via CSS.
Example:
.ms-core-menu-link[title="Compliance Details"],
.ms-core-menu-link[title="Workflows"],
.ms-core-menu-link[title="View Workflow History"],
.ms-core-menu-link[title="Schedule Workflows"],
.ms-core-menu-link[title="Alert me"],
.ms-core-menu-link[title="Shared With"] {
display: none;
}
Of course its also possible to add this css dynamically via JavaScript to the document.head, e.g. based on the users permissions.
Notice:
- Think of the possibility of different languages
- It's better than other JavaScript-Only-Ways, because if the css is in the site, it always work. No need for listening a menu open event or something