Friday, May 14, 2010

Custom webpart Page template in Moss 2007

CUSTOM WEB PART PAGE (only appears in a document library?)

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\STS\DOCTEMP\SMARTPGS"

copy spstd1.aspx and save it as "custom1.aspx"
(note later you may modify it to actually change the template layout)

( Note : "_layouts\images" folder maps to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\images" in IIS).

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\IMAGES

so in ..\12\template\images copy spstd1.gif and rename it 'custom1.gif'

(this is just a little picture to show the user a preview of the template)


CREATING A CUSTOM SPCF ASPX PAGE (ONLY NEEDED ONCE, BUT MODIFIED FOR EACH NEW TEMPLATE)


spcf.aspx page makes use of "OWSSVR.DLL" it's shielded and thus the functionality can't be altered

MS have removed their content explaining how to do this (along with the custspcf.aspx template)
I have downloaded something similar from here:
http://www.dontpapanic.com/download/custspcf.aspx.txt

we now have custspcf.aspx in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS

edit it with the following instructions






Additionally google has cached the original instructions

http://74.125.77.132/search?q=cache:LSPN4h6AEF0J:msdn.microsoft.com/en-us/library/ms916835.aspx+http://msdn.microsoft.com/en-us/library/ms916835.aspx&cd=1&hl=en&ct=clnk&client=firefox-a



ONLY ONCE! NEXT, REFERENCE OUR NEW custspcf.aspx...

open the "create.aspx" page from "_layouts" folder. Search for the code


Search for...



It may look like...

" runat="server">


This is just an HTML table so, we just want to add a link below,



Custom Web Part Page



To be pretty, insert the following code between the "Basic" page and the "Web Part Page"



','','/_layouts/images/ltsmrtpg.gif')" onmouseout="this.className='ms-itemstatic';HideListInformation()" cellspacing="0" cellpadding="0" width="100%" border="0">





<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,viewlsts_wp_page_desc%>' EncodeMethod='HtmlEncode'/> 


Custom Web Part Page





references: http://kittyandbear.net/john/research/wss-3-custom-page-template.txt