I was recently working on integrating a PageLayout deployed to SharePoint through a wsp and I came across a weird behaviour...
Usually to speed things up I like to just deploy an almost raw PageLayout to the masterpage gallery and go ahead and edit directly the deployed file from the SharePoint hive ("C:\Program Files\Common Files\microsoft shared\Web Server Extensions\\TEMPLATE\FEATURES\\mypagelayout.aspx"). Then when I'm satisfied I just report the changes to my Visual Studio project and push to source control.
For this to work you must rely on file ghosting. For those of you who don't know basically when the file in a SharePoint document library is ghosted it is actually a pointer for a file stored in the hive of the front end SharePoint server. When it's unghosted it points to a file stored in the database.
Unghosting occurs when you edit the file from the SharePoint instance or if you make changes with SharePoint Designer.
To sum it all, provision a file through wsp then edit it from the hive and you will immediately see the changes reflect in your site by hitting F5 (no redploying of the wsp nor issreset). By doing so you save a tremendous amount of time integrating your HTML/CSS.
So here's what happend, deploying my aspx through a wsp as usual with Visual Studio 2015, I figured out Microsoft has changed something in the page layout template that will provision the page in an unghosted state no matter what...
At the end of the tag on top of the file you will find this:
meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document"
>
Remove this in order to get the previous behaviour.
Peace!
Usually to speed things up I like to just deploy an almost raw PageLayout to the masterpage gallery and go ahead and edit directly the deployed file from the SharePoint hive ("C:\Program Files\Common Files\microsoft shared\Web Server Extensions\
For this to work you must rely on file ghosting. For those of you who don't know basically when the file in a SharePoint document library is ghosted it is actually a pointer for a file stored in the hive of the front end SharePoint server. When it's unghosted it points to a file stored in the database.
Unghosting occurs when you edit the file from the SharePoint instance or if you make changes with SharePoint Designer.
To sum it all, provision a file through wsp then edit it from the hive and you will immediately see the changes reflect in your site by hitting F5 (no redploying of the wsp nor issreset). By doing so you save a tremendous amount of time integrating your HTML/CSS.
So here's what happend, deploying my aspx through a wsp as usual with Visual Studio 2015, I figured out Microsoft has changed something in the page layout template that will provision the page in an unghosted state no matter what...
At the end of the
>
Remove this in order to get the previous behaviour.
Peace!
Comments