Tuesday, August 30, 2011

Sharepoint 2010 deploy .webpart file Custom Group instead of Miscellaneous.

Goal
To deploy a web part using Module in Visual Studio project. The webpart should be deployed in group custom name "MBD Web Parts" and not in "Miscellaneous".

  • Open Visual Studio 2010.

  • File > New > Sharepoint > Empty Sharepoint Project > Name it "Sample"

  • Right click project > Add a Module > Name "Something".

  • Remove Sample.txt. Add a file(DemoWebPart.webpart) to the module.

  • Make the below given changes to the "Element.xml".

  • Right click project and deploy.

  • Visit your website.

  • Site Actions > Edit Site

  • Click "Add a Web Part". On the top ribbon.


You should now be able to see webpart in "MBD Web Parts" and not in "Miscellaneous".

Change in Element.xml



<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module List="113" Name="Something" Url="_catalogs/wp">
<File Path="Something\DemoWebPart.webpart" Url="DemoWebPart.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="MBD Web Parts" />
</File>
</Module>
</Elements>


Hope this is helpfull for you!

7 comments:

  1. This is very helpful article, really nice.....
    I just want to know how to apply next previous button functionality in xslt listview webpart in sharepoint. Please give me solution because of i am trying to solve this problem from last two weeks.I hope you are understanding my situation. Please help......

    My email id is rohit.dhiman2011@gmail.com

    ReplyDelete
    Replies
    1. @Rohit,

      Is this what you are looking for,

      http://maulikdhorajia.blogspot.in/2011/06/sharepoint-2010-customize-paging-in.html

      Thanks,
      Maulik Dhorajia

      Delete
    2. I have also watched this link but, this is the entire functionality i want only the templates and code which is required only for those previous and next buttons. Only that much code. I already have a look on the link which you told and tried it and it works, but please provide me the code only required for previous and next button. I will be very thankful for you.Really your blogs are very helpfull......Please help me!!!!!!

      Thanks
      Rohit Dhiman

      Delete
    3. @Rohit,

      Check your email I did sent you an email with attachments. That should help you out.

      But here is my advice. Go through the xslt very slowly. You will see most of the site will call templates. I just did that same thing. I created my own template for paging using whatever was there in the current xslt.

      Thanks,
      Maulik Dhorajia

      Delete
  2. Thanks so much maulik.......will contact for some more beautiful stuff from you. Thanks alot.

    ReplyDelete
  3. Thank you Maulik... Very helpful!!!

    ReplyDelete