Mobile 列表視圖/表單頁面(頁首/主體/頁腳)各由一個選擇器控制項發起鏈式調用:
| 選擇器 | 負責區塊 | 類別 |
|---|---|---|
| 頁首 | Title | SPMobileListTitle |
| 主體 | Contents | SPMobileListContents |
| 頁腳 | Navigation | SPMobileListNavigation |
Mobile_{ListTypeID}_{PageType}_{PageArea}
| 元件 | 說明與取值來源 |
|---|---|
| ListTypeID | 列表範本 ID(如 104)或 SPListTemplateType 列舉值(如 Announcements、Contacts)。來源同欄位渲染。 |
| PageType | 頁面類型:View、NewForm、EditForm、DispForm、DeletePage。 |
| PageArea | 頁面區塊:Title、Contents、Navigation。 |
找不到特定模板時,回退 Mobile_Default_{PageType}_{PageArea}。
預載於 MobileDefaultTemplates.ascx:
Mobile_Comments_DeletePage_NavigationMobile_Comments_View_NavigationMobile_DiscussionBoard_DispForm_ContentsMobile_DiscussionBoard_EditForm_ContentsMobile_DiscussionBoard_EditForm_NavigationMobile_DiscussionBoard_NewForm_NavigationMobile_DocumentLibrary_View_NavigationMobile_Events_DispForm_NavigationMobile_Events_EditForm_NavigationMobile_Events_NewForm_NavigationMobile_Events_View_ContentsMobile_Posts_DeletePage_NavigationMobile_WebPageLibrary_DispForm_ContentsMobile_WebPageLibrary_DispForm_Navigation同前:**勿修改 MobileDefaultTemplates.ascx**。同 ID 自訂模板會覆寫(字母序後勝出),同檔重複 ID 皆不載入。預設模板 Mobile_Default_* 亦在該檔,同樣風險。
.ascx 置於 \12\TEMPLATE\CONTROLTEMPLATES。<SharePoint:RenderingTemplate>,ID 依 Mobile_{ListTypeID}_{PageType}_{PageArea} 格式。<Template> 內放置控制項或巢狀 SPMobileComponent。iisreset 生效。<SharePoint:RenderingTemplate RunAt="Server" ID="Mobile_104_View_Navigation">
<Template>
<mobile:Link RunAt="Server" Text="ASP.NET Website" NavigateUrl="https://www.asp.net" />
<mobile:Label RunAt="Server" Text="" BreakAfter="True" />
<SPMobile:SPMobileComponent RunAt="Server" TemplateName="Mobile_Default_View_Navigation" />
</Template>
</SharePoint:RenderingTemplate>
此模板在公告列表視圖頁頁腳**新增 ASP.NET 連結**,並透過 SPMobileComponent 內嵌預設導航模板,達到「擴充而非取代」效果。
| PageType | Title | Contents | Navigation |
|---|---|---|---|
| View | Mobile_{LID}_View_Title | Mobile_{LID}_View_Contents | Mobile_{LID}_View_Navigation |
| NewForm | Mobile_{LID}_NewForm_Title | Mobile_{LID}_NewForm_Contents | Mobile_{LID}_NewForm_Navigation |
| EditForm | Mobile_{LID}_EditForm_Title | Mobile_{LID}_EditForm_Contents | Mobile_{LID}_EditForm_Navigation |
| DispForm | Mobile_{LID}_DispForm_Title | Mobile_{LID}_DispForm_Contents | Mobile_{LID}_DispForm_Navigation |
| DeletePage | Mobile_{LID}_DeletePage_Title | Mobile_{LID}_DeletePage_Contents | Mobile_{LID}_DeletePage_Navigation |
掌握此 ID 體系,即可精準定制任意列表、任意頁面、任意區塊的 Mobile 渲染行為。