I am trying to create a custom content type where the Document Template is a webpart page with multiple webparts already on it.

My problem is, I created a page in a page library, saved a copy of that page and then set it as the Document Template. However, when I create a document library with this content type, clicking the "New" button opens the aspx file in designer.

Is there any way to accomplish this without code? It should function similar to the "link to a document" content type, in that when you click "New" you are taken to the metadata form and once that is filled in a new aspx is created in the library.

Any help would be appreciated.

EDIT: This is a MOSS environment.

  • Is the site a publishing site? The reason I ask, is because you could probably use Page Layouts if it is enabled.
    – Kit Menke
    Commented May 9, 2011 at 21:05
  • Ideally a team site. If absolutely needed I may be able to enable the publishing features. Commented May 9, 2011 at 22:59
  • Under Document Library Advanced Settings, Browser-enabled Documents, have you selected Display as a Web Page?
    – Laurie
    Commented May 10, 2011 at 3:55
  • @Laurie yes, I think that only affects once the document is already added to the library Commented May 10, 2011 at 13:37

2 Answers 2


you can't have Web Parts Page with Web Parts as a Document template. Web Parts and all the personalization data (including position on the page, size, toolbars etc) are stored in Content DB. You can see that you need new data pushed to Content DB every time you creating new Document from your template. Thus only code. Good luck! UPDATE (as answer to additional questions from the comments): well, when you are clicking "New" button you always get your new document created from your template (WebPart Page) and opened for editing. Actual UX will depend on your settings for the document type - if your system configured to edit .aspx files in SPD you will have it opened in SPD and so on. Ways to change it: 1. Change "New" button behavior by Custom Action (kind of custom dev) 2. Change "New" button behavior for particular page by javascript (pure custom dev but could be done easily with CEWP) 3. Update your .aspx file extensions associacion 4. see @Laurie 's suggestion above (sounds good although I can't test it myself right now)

  • It is worth highlighting that it isn't too hard to create pages using code. You will have to programmatically add the web parts after creation of the SPFile for the page, though.
    – Andy Burns
    Commented May 10, 2011 at 12:33
  • is it possible minus the webparts? Commented May 10, 2011 at 13:49

I believe you need a custom page layout as well and your site template must be of a publishing site to do this code-less. Checkout my article @ http://www.dotnetcurry.com/ShowArticle.aspx?ID=638

The above is in 2010 but I've done it in 2007 as well. Steps are pretty much the same, the UI elements look different in 2007.

The following seems to suggest you can enable Publishing in a team site and get it going in 2007 http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-publishing-page-layout-HA010174128.aspx

  • +1, I think a page layout is the way to go if you can't write any code.
    – Kit Menke
    Commented May 12, 2011 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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