WSS3SDK the steps for customizing a mobile homepage

Source: Internet
Author: User

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.