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.

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 BurnsMay 10 '11 at 12:33

is it possible minus the webparts?
–
James MontagneMay 10 '11 at 13:49