我在 SharePoint 2013 应用程序中创建了一个列表,并且 Schema.xml 包含以下与 AllItems 视图相关的节点。
<View BaseViewID="1"
Type="HTML"
WebPartZoneID="Main"
DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;"
DefaultView="TRUE"
OrderedView="TRUE"
MobileView="TRUE"
MobileDefaultView="TRUE"
SetupPath="pages\viewpage.aspx"
ImageUrl="/_layouts/15/images/generic.png?rev=23"
Url="AllItems.aspx">
我想SetupPath="pages\viewpage.aspx
用我自己的页面替换,所以我可以根据客户的要求对其进行品牌化。我已经创建了我的Pages\CustomViewPage.aspx
,但我不知道如何引用我的自定义页面。
我尝试了以下属性。我替换SetupPath
为Path
,请参阅View Element (List):
<View BaseViewID="1"
Type="HTML"
WebPartZoneID="Main"
DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;"
DefaultView="TRUE"
OrderedView="TRUE"
MobileView="TRUE"
MobileDefaultView="TRUE"
Path="~site/pages/customviewpage.aspx"
ImageUrl="/_layouts/15/images/generic.png?rev=23"
Url="AllItems.aspx">
如果我使用Path="~site/pages/customviewpage.aspx"
or Path="../pages/customviewpage.aspx"
,则无法部署应用程序并且错误不是很有帮助(SharePoint Online):
@"Error 1
CorrelationId: aedf6556-ac09-4b0e-9367-905c81563a57
ErrorDetail: There was a problem with activating the app web definition.
ErrorType: App
ErrorTypeName: App Related
ExceptionMessage: <nativehr>0x80131600</nativehr><nativestack></nativestack>
Source: AppWeb
SourceName: App Web Deployment
Error occurred in deployment step 'Install app for SharePoint':
Failed to install app for SharePoint. Please see the output window for details.
如果您知道如何引用您自己的自定义 ListView 页面,请给我留言。谢谢你。