CJ

The circle of life – ** .Net – Training – MOSS **

  • Past Post

  • Vistor Locations

How to add a webpart into a special group other than miscellaneous

Posted by CJ on January 8, 2009

By default, SharePoint web parts are always put into a web part group called “Miscellaneous”.

If you want to automate this process when deploying your web parts as a Feature you can do the following:

In your web parts element manifest file

<ElementManifests>
    <ElementManifest Location=”MyWebPart\MyWebPart.xml” /> this is the file you edit
    <ElementFile Location=”MyWebPart\MyWebPart.webpart” />
  </ElementManifests>

 

Add the following elements

<Module Name=”WebParts” List=”113″ Url=”_catalogs/wp”>
      <File Path=”FlarePoint.MyWebPart.webpart” Url=”FlarePoint.MyWebPart.webpart” Type=”GhostableInLibrary”>
          <Property Name=”Group” Value=”FlarePoint Web Parts” />this is what you add for the Group
          <Property Name=”Title” Value=”FlarePoint.MyWebPart” />this is what you add for the Title
          <Property Name=”WebPartDescription” Value=”FlarePoints MyWebPart description” />this is what you add for the Description
      </File>
  </Module>

Good post on doing this via the object model
http://blogs.msdn.com/cliffgreen/archive/2008/04/18/adding-web-parts-to-the-web-part-gallery-using-the-sharepoint-object-model.aspx

5 Responses to “How to add a webpart into a special group other than miscellaneous”

  1. ramneek said

    Hi CJ,

    I cant get it to work. I am using smarttemplate(http://www.codeplex.com/smarttemplates) to build and deploy my webparts. The webpart is still appearing under miscellaneous category even after doing this change.

    please let me know what change i have to do for it.

    Thanks
    Ramneek

    • boriska said

      Hi Ramneek,
      the property “Group” is visible onto webparts gallery page (/_catalogs/wp/Forms/AllItems.aspx), anyway, you should also add <Property Name="QuickAddGroups" Value="mySmartTemplates” /> if you want to see your webpart from a custom group in your dialog webpage “Add a webpart”…
      and don’t forget to check if your very last modifications have been taken into account…

  2. Biju said

    Hi,
    I have developed an event handler,called TaskListEventHandler, for the Task list ((ItemAdding, ItemDeleting, ItemUpdating) as feasture using the WSP Builder project template, and I have also added a web part, called RegisterEventHandler, which could be used to bind(register) the events to a list. The webpart is WSP Builder template “Webpart without feature”.

    Currently, on deployment, my feature and the webpart is getting deployed sucessfully. The web part is available in the web part gallery (SiteSetting->EditPage–> Add a webpart).

    Now i need to make the web part available in a particular category/group in the gallery using the WSP Builder?
    I tried setting the group in the RegisterEventHandler.webpart file (which is automatically created by WSP builder on adding the webpart template inot the project), but still it doesn’t show up :(

    Cannot import RegisterEventHandler Web Part.

    RegisterEventHandler
    This webpart is used to register or unregister the event handler to the task list – By Biju (09 Sep 2009)
    Biju Webparts

    Could anyone please help or suggest me some solution or sample code?With regardsBiju

  3. Biju said

    my .webpart file has the following contenet

    Cannot import RegisterEventHandler Web Part.

    RegisterEventHandler
    This webpart is used to register or unregister the event handler to the task list – By Biju (09 Sep 2009)
    Biju Webparts

  4. Biju said

    Cannot import RegisterEventHandler Web Part.

    RegisterEventHandler
    This webpart is used to register or unregister the event handler to the task list – By Biju (09 Sep 2009)
    Biju Webparts

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>