I created a list in a SharePoint 2013 App and the Schema.xml contains the following node related to the AllItems view.
<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">
I'd like to replace SetupPath="pages\viewpage.aspx with my own page, so I can brand it as per my client's requirements. I've already created my Pages\CustomViewPage.aspx, but I cannot figure out how to reference my custom page.
I've tried the following attributes. I replaced SetupPath with Path, see 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">
If I use Path="~site/pages/customviewpage.aspx" or Path="../pages/customviewpage.aspx", the application cannot be deployed and the error is not very helpful (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.
If you know how to reference your own custom ListView page, please drop me a line. Thank you.
I found a workaround, it's not exactly what I was looking for, but it will do for now.
Pages\CustomViewPage.aspxunder the folderPages, then I moved my custom page toLists\MyList\CustomViewPage.aspx.Lists\MyList\CustomViewPage.aspxand select Properties.Then set the
Viewtag as follows. Please note the attributeSetupPathwas replaced withPath:It's obvious the issue was related to the path which was incorrect. The workaround above places the custom form in the same folder as the list. If you know a way to reference a file on another folder, please drop me a line.