CUSTOM TEMPLATE PAGE
We want a custom site template...
Step 1: Clone an existing Site Definition.
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates COPY Blog and rename it TEST
Step 2: Modify the WEBTEMP.XML file to register the Site Definition with SharePoint.
(format:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML\WEBTEMP.XML
Step 3: Reset IIS
If you try to create a new Site & Workplace you'll now notice that TEST appears as an option. (But it will merely be another copy of Blog)...
Now any time you create a new site of type TEST it will use the "default.aspx" to control the layout.
IT IS BEST TO USE THE BLANK SITE Template (which is a version of the STS...) but be aware, when you modify
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML\WEBTEMP.XML
The Template name is STS but it has multiple configurations! (which I've reduced to one)
IF you choose Configuration ID="0" then it will make one
After an IIS Restart/Reset, when in WSS you try to create a new site/workspace under the Collaboration Tab you'll see TEST and Custom Blank Site at the end...
IF YOU ACCIDENTALLY COPY MPS and rename it TEST2 (instead of sts) you'll get funny errors! IF YOU GET "INVALID PAGE" OR INVALID WEB PART ERRORS
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
stsadm.exe -o deleteweb -url http://wssteset/portal/mistakenpage/page1
(or deletesite)
If you ever need to work on one of these errors append "?contents=1" at the end in your browser address bar
e.g. original (invalid error!) http://wsstest/Portal/testsite/blanktest/_layouts/spcontnt.aspx?&url=%2fAndersPortal%testblanktest%2fdefault.aspx
http://wsstest/Portal/testsite/blanktest/_layouts/spcontnt.aspx?&url=%2fAndersPortal%testblanktest%2fdefault.aspx?contents=1
WHICH takes you to the Web Part Page Maintenance where you can close or delete the problem parts...
OR
If the problem is in the layout
You merely have to rename default.aspx to default.aspx.problem and rename default.aspx.bak back into default.aspx
This will load whatever the original TEMPLATE layout was (but at least you can delete your messed up page).
Now look for the "default.aspx" page and make a backup copy...
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\TEST
Modify default.aspx (it is C# / ASPX code, like XML and HTML)
Obvious changes might be removing the "Small Search box"
A new site of template TEST based on the above default.aspx won't have the "search" box...
I WANT A SPECIFIC NUMBER OF COLUMNS, THUS THE
using the things we learned (below) about creating a custom web part page layout
I've actually replaced the TEST default.aspx with C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\TEST
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
<SELECT id="onetidWebPartPageTemplate" name="WebPartPageTemplate" size="2" onchange="DoTemplateOptionChange()">
<OPTION value="custom1" selected="true">Custom Template 1 Description</OPTION>
<OPTION value="custom2">Custom Template 2 Description</OPTION>
</SELECT>
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...
This is just an HTML table so, we just want to add a link below,
To be pretty, insert the following code between the "Basic" page and the "Web Part Page"
<table style="padding: 3px 0px 3px 4px;" class="ms-itemstatic" onclick="javascript:NavigateInnerHref(event)" onmouseover="this.className='ms-itemhover';ShowListInformation('<SharePoint:EncodedLiteral runat="server" EncodeMethod="EcmaScriptStringLiteralEncode" Text="<%$Resources:wss,viewlsts_wp_page_title%>"/>','<SharePoint:EncodedLiteral runat="server" EncodeMethod="EcmaScriptStringLiteralEncode" Text="<%$Resources:wss,viewlsts_wp_page_desc%>"/>','/_layouts/images/ltsmrtpg.gif')" onmouseout="this.className='ms-itemstatic';HideListInformation()" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td valign="top" nowrap class="ms-descriptiontext" style="padding-top:1px">
<IMG src="/_layouts/images/setrect.gif" width=5px height=5px alt="<SharePoint:EncodedLiteral runat='server' text='<%$Resources:wss,viewlsts_wp_page_desc%>' EncodeMethod='HtmlEncode'/>">
</td>
<td valign="top" width=100% class="ms-descriptiontext">
<a id="onetidWebPartPage" href="custspcf.aspx" target="_self">Custom Web Part Page</a>
</td>
</tr>
</table>
You can press F5 as you modify and save the create.aspx page to see the changes in WSS
sample custspcf.aspx / default.aspx (with only two columns) <%-- _lcid="1033" _version="12.0.4518" _dal="1" --%> <%-- _LocalBinding --%>
--- above not necessary? ---
<%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>