SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a MOSS 2007 SharePoint site definition for my users, and now want to use a custom default.aspx page as a landing page every time a new site using that definition is created. That default web page needs to display some web parts pointing to site relative data e.g. I want it to display some documents from a local document library on the site.

I've opened a site in SPD and modified the current default.aspx page by adding a web part pointing to the document library. However, the links in the code point to the library on the site I'm looking at in SPD. How do I save this page as a template so that it points to the local library whenever it gets deployed to a new site? Is that even the right way to do it?

I've got the core publishing feature activated if that helps, although this is not a publishing site so doesn't have the full range of publishing options.

share|improve this question

migrated from Jun 21 '11 at 19:12

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

You'd do this using a feature. Save the page to your machine, then create a solution using Visual Studio (and say WSPBuilder) that deploys the page to your site. It'll overwrite the existing page. The only problem is that most standard webparts reference lists using their id (a Guid), so you'd need a way to circumvent this. I usually do this by adding a feature receiver to the feature, which allows you to use the SharePoint Object model to perform actions in code.

P.S. more info here:

share|improve this answer
Thanks Colin, that seemed to be the only option open to me, but I'm glad to have it confirmed before I go down that route. – Gerry Jun 22 '11 at 6:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.