The name is a little long and I can't think of any good name.
We often encounter a problem, that is, we need to add a button on the listviewtoolbar of a list or document library view for some operations. For example, page Jump and list operations. At present, many people know that the feature is used to add this button. After the feature is deployed and activated, this button is added to all the list document libraries. This is not what we want. The effect we want is that there is a button on the list to be added, and there is no such button on the list that is not needed. The original buttons on the listviewtoolbar are: Create, operate, and set. The document library will upload one more button. If you need to add buttons to all the lists or document libraries of the website, you can use feature to add them under these buttons. However, it seems impossible to add a list or document library. At least I still don't know what method to use. The following describes how to add a button in the toolbar of a specific list or document library through featue.
Let's take a look at it first.
The "test" button has been added"
No button added
Procedure
1. Select "Settings"-"document library Settings" or "list Settings" for the document library or list"
2. Select "Advanced Settings"
3. Select "yes" for "whether to allow content management" and click "OK"
4. If it has been enabled, the content type area will be displayed on the setting screen.
5. Click the name of the content type and you will see "& ctype = 0x0101003205328a478c6f489c49a11b1a5447ba" on the URL"
Ctype is the content type, and the following parameter is the content type ID
You can use this ID to add a button to the list or document library.
6. How to create and deploy feature is not described here. Baidu or Google,
In feature's elements. xml file
Add
XML Version = "1.0" Encoding = "UTF-8" ? > Elements Xmlns = "Http://schemas.microsoft.com/sharepoint" > customaction registrationtype =" contenttype " registrationid =" 0x0101003205328a478c6f489c49a11b1a5447ba " SPAN class = "ATTR"> sequence = "1000" location = "viewtoolbar" title =" test " urlaction URL = "/url" /> customaction
elements >
In the XML fileRegistrationid is contenttypeid,Of courseRegistrationtype is determined by the type.
7. Write the ctype found in the list or document libraryRegistrationid
8. Deploy and activate feature.
There is also another way to add a button in the same position using JS, which needs to be explained.