locked
How to add another webpart in Sharepoint library RRS feed

  • Question

  • I want to add another web part in SharePoint library ALlItems page

    How to add another webpart in SharePoint library?


    AA.

    Tuesday, March 8, 2016 10:34 PM

Answers

  • Hi AA,

    You could achieve it by adding custom code in the allitem.aspx. You could add the two web part zone in one table with one row and two columns.

    You could follow the steps below:

    1. Go to the library, edit the page, and then add the web part in the allitem page. After adding web part, the web part will display the top of the original web part.

    2. Open the site in SharePoint designer, click lists and libraries in the left navigation, and find and open the library.

    3. Open All Documents in the views section, then click the advanced mode in ribbon.

    4. Then find the code “<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">”, and add the code below under it.

    <table>
    
    <tr>
    
    <td>
    

    like the picture below.

    5. Then find “</WebPartPages:XsltListViewWebPart>”, and add the code below under the first “</WebPartPages:XsltListViewWebPart>”.

    </ZoneTemplate>
    
    </WebPartPages:WebPartZone>
    
    </td>
    
    <td>
    
    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main1" Title="loc:Main1"><ZoneTemplate>
    

    6. Then find “</WebPartPages:WebPartZone>”, and add the code below under the second “</WebPartPages:XsltListViewWebPart>”.

    </table>
    
    </tr>
    
    </td>
    

    7. After all, it will like the picture below.

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, March 10, 2016 9:01 AM

All replies

  • Hi AA,

    Which library do you want to add web part? Document library?

    You could go to the library and select the all items view, then click the settings like a gear in the upper right corner of the page and select “edit page”. Then you can add web part in the library allitems page.

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.


    • Edited by Sara Fan Wednesday, March 9, 2016 1:53 AM
    Wednesday, March 9, 2016 1:52 AM
  • Thank you for your comments but I don't want to add the web part on the top or bottom of the page.

    I want to add the new web part adjacent to the existing xsltlistview web part.


    AA.

    Wednesday, March 9, 2016 4:47 AM
  • Hi AA,

    You could use web part page and select one payout template which you want, then add the web parts in the page.

    You could go to site pages library, click new document and select web part page.

    If there is no layout template you want to use, you could add web part zone by customizing page layout. For more detailed information, you could refer to the article below.

    How to: Add a Web Part zone snippet in SharePoint 2013.

    https://msdn.microsoft.com/en-us/library/office/jj862341.aspx

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, March 9, 2016 9:27 AM
  • Hi Sara,

    Thank you for your comments but I want to add the new web part in library Alitems page only. So, is there any provision?

    Thank you.


    AA.

    Wednesday, March 9, 2016 2:48 PM
  • If you need to add the web part adjacent to the existing xsltlistview , Then which type of page are you on? 
    Wednesday, March 9, 2016 5:35 PM
  • It's a SHarePoint library page.

    AA.

    Wednesday, March 9, 2016 6:03 PM
  • Hi AA,

    You could achieve it by adding custom code in the allitem.aspx. You could add the two web part zone in one table with one row and two columns.

    You could follow the steps below:

    1. Go to the library, edit the page, and then add the web part in the allitem page. After adding web part, the web part will display the top of the original web part.

    2. Open the site in SharePoint designer, click lists and libraries in the left navigation, and find and open the library.

    3. Open All Documents in the views section, then click the advanced mode in ribbon.

    4. Then find the code “<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">”, and add the code below under it.

    <table>
    
    <tr>
    
    <td>
    

    like the picture below.

    5. Then find “</WebPartPages:XsltListViewWebPart>”, and add the code below under the first “</WebPartPages:XsltListViewWebPart>”.

    </ZoneTemplate>
    
    </WebPartPages:WebPartZone>
    
    </td>
    
    <td>
    
    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main1" Title="loc:Main1"><ZoneTemplate>
    

    6. Then find “</WebPartPages:WebPartZone>”, and add the code below under the second “</WebPartPages:XsltListViewWebPart>”.

    </table>
    
    </tr>
    
    </td>
    

    7. After all, it will like the picture below.

    Best regards,

    Sara Fan


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, March 10, 2016 9:01 AM
  • Hi

    From what you understand you need to add another webpart in document library in sharepoint 2013

    Navigate to AllItems.aspx>Click on settings you will see option Edit page.

    When you click on it you will automatically get Add webpart option.This is OOB in sharepoint 2013.

    Another way is If you have created custom schema.xml for list then you need to define your webparts in schema.xml file using allusers webpart  tag and it will automatically get added during rendering

    Sorry, Sara also has mentioned has same thing.That is correct
    • Edited by agarwal Thursday, March 10, 2016 10:27 AM
    Thursday, March 10, 2016 10:26 AM