SharePoint Designer broke my Page Layout. How do I repair it?
-
16-10-2019 - |
Question
I have a Page Layout which is used by some Publishing Pages, and uses code-in-front like <%= DateTime.Now %>
.
I opened this Page Layout in SharePoint Designer and modified it and saved it, and now it says
Page cannot contain code blocks
My first idea was to manually revert the Page Layout to its previous state (again using SharePoint Designer), but that solved nothing, presumably since the page itself isn't broken.
Then I wanted to delete the Page Layout and re-install it, but that's not possible since it's in use by Publishing Pages. Or is it?
Then I wanted to allow code blocks for this particular page by adding PageParserPaths
, but I don't know which VirtualPath
my Page Layout has.
How can I repair my Page Layout?
Solution
Revert to the previously published version?
Unghost the file? ("Revert to Site definition" option in Site Settings).