Custom WebPart Page Template with Navigation

on Tuesday, March 2, 2010

Steps to add Custom Web Part Page Templates

  1. Download custom creation page (custspcf.aspx) from here and copy it 12 hive on your Web front end servers.  The file should be copied to the following directory Local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\1033.   (Note: If you are running on a server installed in a language other than English replace 1033 with the Language Code Identifier for your language.)

  2. Open the new custspcf.aspx file in Visual Studio or another suitable text/html editor.
  3. Search for onetidWebPartPageTemplate in the custspcf.aspx file.  This is the ID of the selection list for the Web Part Page templates.  There are two selections already included for the file, one for Custom1.aspx (set to be the default selection) and the other for Custom2.aspx.  If you only want two custom templates skip step 4.
  4. To add additional templates increment the size attribute of the Select element to the number of choices in the list and duplicate the second Option element in the list.  Change the name value of the Option element using a pattern of Custom#, where # is the next index in the list of selections.
  5. Search for onetidPreviewImage in the custspcf.aspx file.Specify the image in the src attribute for the template which will be selected by default.Name each image file the same as webpart template name. For example if the webpart template name is custom1.aspx then image name should be custom1.gif

  6. Add the new custom Web Part Page template, named Custom# to match the entry in step 4, to the Local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\1033\STS\DOCTEMP\SMARTPGS directory.  
  7. Copy an image file named Custom#.gif for each of the Web Part Page templates you wish to add where # is the number of the template in the list to Local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\1033\IMAGES
  8. Add a Link to custspcf.aspx to the Create.aspx page stored in the Local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS directory. The custspcf.aspx needs to be deployed to layouts page and the image files needs to be deployed to template\\layouts\images folder. You can use wsp to deploy these files to these folders.

0 comments: