SharePoint uses Featue to add a button on a listviewtoolbar to a specific document library or list

Source: Internet
Author: User

One problem we often encounter is the need to add a button to the Listviewtoolbar of a list or document library view screen to do some action. For example, page jump, list operation and so on. At present, many people know to use feature to add this button, and feature after the deployment of the activation, will be all the list document library added the buttons. This is not the effect we want. The effect we want is to add to the list, have this button, don't need to have this button on the list. On the Listviewtoolbar, the original button has, new, operation, settings, the document library will be one more upload. If you need to add a button to a site's list or document library, you can use feature to add it underneath the buttons. But if you want to add to a list or document library, it seems unlikely. At least for now, I don't know what to do with it. The next way to do this is to add a button to the toolbar of a particular list or a view of a document library by Featue.

Look at the effect chart first

The button "Test" has been added.

Without the Add button

Set steps

1. Select the document library or list "settings"-"Document library Settings" or "List settings"

2. Select "Advanced Settings"

3. "Whether to allow management of content types" select "Yes", click "OK"

4. If it has been opened, it will be seen in the Settings screen, content type area

5. Click on the name of the content type, you can see "&ctype=0x0101003205328a478c6f489c49a11b1a5447ba" on the URL

CType is the content type, and the following argument is the ID of the content type

With this 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 introduced here. Can be Baidu or Google,

In the Elements.xml file of feature

Add to

XML version= "1.0" encoding= "Utf-8"?> <elements xmlns=  
"http://schemas.microsoft.com/sharepoint/" >  
    <customaction  Registrationtype= "ContentType"
                   registrationid= "0x0101003205328a478c6f489c49a11b1a5447ba"
                   sequence= " 1000 " 
                   location=" Viewtoolbar "
                   title=" Test ">  
        <urlaction url="/url  
    "/> customaction>  
elements>
The Registrationid in an XML file is Contenttypeid, of course, depending on what type of Registrationtype it is.

7. Writes the CType found in the list or document library to Registrationid

8. Deploy, activate feature.

There is also a use of JS in the same position to add a button, there is a need to explain it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.