This walkthrough will show you how to customize the mobile home page by implementing a custom Renderingtemplate control. The following example shows how to customize the header portion of a home page.
Spmobilewebtitle
On the STS Home page, a Spmobilewebtitle object is declared in the heandertemplate element in mbllists.aspx:
<HeaderTemplate>
<SPMobile:SPMobileControlContainer RunAt="Server" Weightless="true">
<SPMobile:SPMobilePageTitle RunAt="Server" />
<SPMobile:SPMobileComponent TemplateName="MobileDefaultSeparator" RunAt="Server" />
</SPMobile:SPMobileControlContainer>
</HeaderTemplate>
This object determines which renderingtemplate is to render the header portion of the mobile home page based on the current site definition. For example, if you want to render the header portion of the STS home page on a Mobile device, the object will attempt to use the Enderingtemplate with ID mobile_sts_homepage_title. If you don't find it, go straight to Mobile_default_homepage_title.
Windows SharePoint Services 3.0 does not have a renderingtemplate with a built-in ID of mobile_sts_homepage_title. In this walkthrough, you will create a new page title that increases its font size and becomes bold.
Steps
In a text editor, create a text file (UTF-8), named Stshomepagetitle.ascx. stored in the Local_drive:\program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\controltemplates directory.
Add the following points to markup to the file:
<%@ Control Language="C#" %>
<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SPMobile" Namespace="Microsoft.SharePoint.MobileControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
Then, add a Renderingtemplate object below it to set the id:mobile_sts_homepage_title of the Spmobilewebtitle object whose ID is searched by the mbllists.aspx page.
<SharePoint:RenderingTemplate ID="Mobile_STS_HomePage_Title" RunAt="Server" >
</SharePoint:RenderingTemplate>
In the Renderingtemplate element, define a Template element to contain a Label child control. Set the Text, Font-size, and Font-bold properties of the label:
<Template>
<mobile:Label Text="Custom STS Home Page Title" Font-Size="Large" Font-Bold="True" RunAt="Server" />
</Template>