“Code blocks are not allowed” error when applying custom masterpage to search center

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/225892

  •  01-01-2021
  •  | 
  •  

Question

We are getting the error below when applying a custom masterpage (based on an HTML masterpage) to a search center in a SharePoint 2016 site collection.

An error occurred during the processing of /sites/[name of site]/search/results.aspx. Code blocks are not allowed in this file.

Scope of the issue

So far the search center result page is the only page we see this on. The settings page of the search center can be used without issues. Also creating site pages on the search center can be done without issues.

Steps tried

  • We investigated suggestions that would require you to change the web.config but did not follow this course due to security risks.
  • Tried to reset the page to the site definition but could not find the button in SharePoint Designer 2013 nor the site itself.
Était-ce utile?

La solution

Enabling the SharePoint Server Publishing feature in the search centers' site features fixed this issue.

An alternative solution (workaround) would be to use a new site page as a search results page.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top