1
votes

I am quite new to SharePoint and have been given an interesting problem to solve. My users have requested to each have a custom home page that they can customise with ease. The design I have been given is to have an almost blank page with space for 4 webparts organised in a 2 by 2 fashion (2 webparts by 2 webparts) each with a big '+' button in witch to click to select and add a widget of their choosing without having to play around with the ribbon. This is expected to look something like this:

http://imageshack.us/photo/my-images/841/homepages.jpg/

Now when a user clicks a '+' a SharePoint dialog is to be displayed allowing the user to choose from all available web parts. On selecting one the home page is refreshed and the widget is displayed in the selected zone.

I am currently trying to de-risk this request to see if it is possible to achieve in the time frame given. The problems I have at the moment are as follows:

  1. Programmatically getting a list of all available webparts to display in the dialog.
  2. On the selection of the webpart programmatically adding that chosen webpart to the correct part of the home page without hard coding the type of webpart (so the code does not need to be changed when a new webpart is added to SharePoint for users to add).

I would really appreciate any help or advice on this. Thanks in advance and sorry if the question is well phrased, this is my first Stack Overflow question!

1
I think you'll get quicker and better help on SharePoint SE. Also, you should explore the built-in "My Site" concept.bzlm
Thanks bzlm for your very quick response. I am looking into My Site but that does not mitigate my current 2 problems. Thanks for the SharePoint SE link though, it looks to be very useful!user969304
What you describe sounds very similar to how Web Parts in SharePoint normally work. I think re-invent that wheel is unrealistic, considering how cumbersome and undocumented SharePoint API development is. I'd try to "style" the built-in stuff instead, which is perfectly doable.bzlm

1 Answers

0
votes

Just create a webpart that does that. Render a big plus sign and when a user clicks there, the event handler gets all webparts available and renders it to a dropdownlist for instance. The rest is easy, when a user selects one, get it (by guid/name whatever) and add it to the zone where the first webpart was present, not forgetting to remove the plus sign webpart from the clicked webpart zone first. This can be achieved using the SPLimitedWebPartManager.

The tricky part could be the Webparts that are available on the SiteCollection, but you could research on that.

Regards,

Pedro