views:

34

answers:

1

Hello, I have a website in Sharepoint 2007 (it is a publishing portal).

I want to create a site with more specific info than what it comes with Sharepoint. You know, when you create a new site, the only info you can enter is title and URL.

I would need an image and a description.

The solution is not a custom list, because i need to have pages inside and other lists.

How can i extend this site list?

+2  A: 

Write an application page or web part that creates the new site. Programmatically update it with what users enter in your custom form.

Creating the site

The SPWebCollection.Add() method creates the site from a site definition. Create a custom definition that includes the site columns, content types and lists required. These will then be created as part of the site.

Further customisations

This won't perform all customisations however - for the rest develop a feature receiver. On activation it will run any arbitrary code on your new site.

For example as you are using a publishing site, retrieve its default page with the DefaultPage property. This is an SPFile object which has an Item property that can be edited like any other SPListItem. Update the image field and description field for the item based on its content type. The page will then render these properties.

All of the above can be wrapped in an SPLongOperation for a nicer user experience.

There are other options as well, for example the SPWebProvisioningProvider. The two separate steps above of creating a site definition and activating a feature receiver could be tied into one with this.

There is more information on the above techniques (plus others) and their pros and cons in part 3 and part 4 of this series by Raymond Mitchell.

Alex Angas
+1 Excellent answer, Alex; you cover all the bases quite nicely!
Sean McDonough