adding files to SitePages
-
06-12-2019 - |
Question
The following code supposed to add copyitem.aspx file to SitePages. I go to the subsite via SP Designer.
I can see "Site Objects" on the left navigation. I click on Site Pages and I get "The Document Library view cannot be displayed for this Web site.". However, I click on All Files (under site objects), I see a "SitePages" with Folder icon and sure enough CopyItem.aspx is there.
Please suggest.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="CopyItem" Url="SitePages" Path="CopyItem">
<File Url="CopyItemTemplate.aspx" Name="CopyItem.aspx" Type="Ghostable" />
</Module>
</Elements>
Solution
I enabled the "publishing feature" and sitepages became available and aspx files were saved in that location. Good luck.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange