Wss3sdk: How to customize the mobile Homepage

Source: Internet
Author: User

This section provides an overview of the basic process for customizing the Windows SharePoint Services 3.0 homepage accessed by mobile devices. Detailed steps participate in subsequent drillsArticle.

As described in the previous section on mobile page rendering mechanism, each control in the mobile homepage's header, content area, and footer (navigation area) results in a chain call, use the following three template selector controls to start the call.

    • Spmobilewebtitle-Select the renderingtemplate control used to render the header.

    • Spmobilewebcontents-Select the renderingtemplate control for the trunk part.

    • Spmobilewebnavigation-Select the renderingtemplate control for the footer.

One of these class objects selects an renderingtemplate object based on the type of the requested page (such as STS, blog, or custom site. That is to say, you can customize the mobile homepage for a specific type of website. For example, you can display a greeting on the mobile homepage of all STS websites.

Note::
MPs, centeraladmin, And wiki websites cannot be accessed from mobile devices.

These controls search for the renderingtemplate ID in the following format:

Mobile _ Sitetypeid _ Homepage _ Pagearea

WhereSitetypeidYesSTS,BlogOr a user-defined site ID, andPagearea Specified Title,Contents, OrNavigationTo represent the area in the page to be rendered.

Based on the current website type,SpmobilewebtitleControl determines whichRenderingtemplateThe object is rendered to the header area of the mobile homepage. For example,SpmobilewebtitleObject will try to use ID =Mobile_sts_homepage_titleTo render an STS homepage on a mobile device. If such an ID is not foundMobile_defaut_homepage_title.

Windows SharePoint Services 3.0 does not provide mobile_sts_homepage_title by default.RenderingtemplateYou can create one.

In this rendering mechanism, creating a mobile homepage that contains a custom header (title), content body, or footer (navigation area) is actually creating a rendering template, its ID is the ID to be searched by the template selector control corresponding to the page area.

Existing renderingtemplate

After WSS is installed, the following two renderingtemplates for the mobile homepage already exist in mobiledefatemplates. ascx.

    • Mobile_blog_homepage_navigation

    • Mobile_sts_homepage_contents

You should not modify thisMobiledefatemplates. ascxFile. You can create a new renderingtemplate element (in your own. ascx file) only by using the same ID as an existing render control. However, this operation poses a risk and may damage other solutions deployed in WSS that depend on the original renderingtemplate object.

Note::

Rendering controls of Windows SharePoint Services 3.0 are loaded before custom controls. Therefore, when custom controls with the same ID exist, the loading of the control template overwrites the original controls. If there are two or more custom control templates with the same ID, the names listed in alphabetical order will overwrite all others. If the specified file contains two or more rendering templates with the same ID, they will not be loaded.

Below Renderingtemplate Objects are also defined in Mobiledefatemplates. ascx File. If no rendering template defined for the current site type is found at runtime, these templates will be used. If you create Renderingtemplate The risks mentioned above also exist when the object uses these IDs.
    • Mobile_default_homepage_contents

    • Mobile_default_homepage_navigation

    • Mobile_default_homepage_title

You can nestRenderingtemplateObject. See the following example.

Part of the custom mobile Homepage
    1. In Microsoft Visual Studio, notepad, or any text editor, create a user control file (. ascx) and place it in the path\ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ controltemplates.

    2. Add several page tags to the file to register and reference the corresponding namespace.

    3. Add a rendering control to the. ascx file with the ID in this format:Mobile _Sitetypeid_ Homepage _Pagearea.

      • SitetypeidIt can be STS, blog, or any ID number defined by the custom site. (The ID defined by the site isWebtemp. xmlFile template ElementID).

      • PageareaYesTitle,ContentsOrNavigation.

    4. Save the. ascx file and restart IIS to make the change take effect.

Example

The following example showsRenderingtemplateDefinition, with another nestedRenderingtemplate.

< SharePoint: renderingtemplate ID = "Mobile_sts_homepage_navigation" Runat = "Server" >
< Template >
< Mobile: Link Text = "Microsoft" Navigateurl = "Http://www.microsoft.com /" Runat = "Server"   />
< Spmobile: spmobilecomponent Templatename = "Mobile_default_homepage_navigation" Runat = "Server"   />
</ Template >
</ SharePoint: renderingtemplate >

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.