2

Is it impossible to edit a page in SharePoint Designer 2010 which is attached to a page-layout? When a try to edit a page in advanced mode, the below message is rendered. How can I add a content or any JavaScript code to such a page? How can I edit the existing code of such a page?

enter image description here

4

A page layout adds controls to the page. The page itself is constructed dynamically, so it cannot be edited in SharePoint Designer.

You can edit the page in the browser and add a Content Editor Web Part into the page body. You can then link that CEWP to a file with javascript, css or html. This is the usual workaround to inject custom elements into a page that is defined by a page layout.

Don't try to edit the html of the CEWP. Most likely SharePoint will strip this out upon saving. Create your custom html/css/javascript in a file. Upload that file to a document library and then link the CEWP on the page to that file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.