SOLVED

How to correctly avoid getting "The current page has been customized from its template"

%3CLINGO-SUB%20id%3D%22lingo-sub-31327%22%20slang%3D%22en-US%22%3EHow%20to%20correctly%20avoid%20getting%20%22The%20current%20page%20has%20been%20customized%20from%20its%20template%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-31327%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20using%20Sharepoint%20Online%20and%20wish%20to%20apply%20our%20own%20CSS%20in%20the%20Site%20Pages%20and%20Wiki%20Pages.%20We%20understand%20that%20changes%20to%20the%20Master%20page%20is%20not%20recommended!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20tried%20to%20modify%20Site%20Pages%20and%20Wiki%20Pages%20directly%2C%20but%20then%20we%20get%20a%20message%20in%20the%20page%20%22The%20current%20page%20has%20been%20customized%20from%20its%20template.%20Revert%20to%20template.%22%20which%20is%20visible%20to%20all%20users%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20is%20the%20template%20that%20is%20mentioned%3F%3CBR%20%2F%3EHow%20to%20correctly%20apply%20our%20own%20styling%2FCSS%20to%20the%20pages%3F%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThank%20you%20in%20advance%20for%20any%20ideas%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%20John%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-31327%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-556307%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20correctly%20avoid%20getting%20%22The%20current%20page%20has%20been%20customized%20from%20its%20template%26amp%3Bquot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-556307%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F8607%22%20target%3D%22_blank%22%3E%40John%20Aage%20Andersen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Etry%20this%20in%20powershell%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-SPOSite%20%3CSITEURL%3E%7Cselect%20DenyAddAndCustomizePages%3C%2FSITEURL%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-%20to%20see%20if%20its%20enabled.%20if%20enabled%2C%20run%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESet-SPOSite%20%3CSITEURL%3E%20-DenyAddAndCustomizePages%200%26nbsp%3B%3C%2FSITEURL%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-31482%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20to%20correctly%20avoid%20getting%20%22The%20current%20page%20has%20been%20customized%20from%20its%20template%26amp%3B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-31482%22%20slang%3D%22en-US%22%3ETo%20me%20the%20answer%20here%20is%20to%20use%20JavaScript%20%2F%20CSS%20injection%20pattern...but%20only%20with%20the%20classic%20UI.%20With%20the%20new%20UI%20we%20still%20need%20to%20know%20%2F%20learn%20how%20to%20do%20it%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-31416%22%20slang%3D%22en-US%22%3ERE%3A%20How%20to%20correctly%20avoid%20getting%20%22The%20current%20page%20has%20been%20customized%20from%20its%20template%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-31416%22%20slang%3D%22en-US%22%3EYou%20could%20this%20using%20jslink%20or%20do%20it%20via%20the%20sitesettings%20and%20select%20a%20css%20file.%20Which%20file%20is%20ghosted%20you%20have%20to%20check%20with%20SharePoint%20Designer.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-558364%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20to%20correctly%20avoid%20getting%20%22The%20current%20page%20has%20been%20customized%20from%20its%20template%26amp%3B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-558364%22%20slang%3D%22en-US%22%3E%3CP%3EAgree%20with%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3Bhere.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20%22Template%22%20is%20referring%20to%20a%20page%20layout%20(basically%20a%20definition%20of%20what%20a%20page%20should%20look%20like).%26nbsp%3B%20However%2C%20as%20Juan%20mentions%2C%20you%20should%20keep%20your%20customization%20loosely%20coupled%20to%20the%20pages%2C%20and%20inject%20references%20to%20your%20CSS%20into%20the%20page%20through%20JavaScript.%20This%20can%20be%20done%20via%20User%20Custom%20Actions.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-565581%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20How%20to%20correctly%20avoid%20getting%20%22The%20current%20page%20has%20been%20customized%20from%20its%20template%26amp%3B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-565581%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20you%20want%20to%20remove%20the%20message%20from%20modern%20sites%20use%20the%20powershell%20I%20provided.%20This%20was%20given%20to%20me%20from%20MS%20support%20and%20it%20works.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

We are using Sharepoint Online and wish to apply our own CSS in the Site Pages and Wiki Pages. We understand that changes to the Master page is not recommended!

 

We have tried to modify Site Pages and Wiki Pages directly, but then we get a message in the page "The current page has been customized from its template. Revert to template." which is visible to all users

 

What is the template that is mentioned?
How to correctly apply our own styling/CSS to the pages?


Thank you in advance for any ideas :)

   John

5 Replies
Highlighted
You could this using jslink or do it via the sitesettings and select a css file. Which file is ghosted you have to check with SharePoint Designer.
Highlighted
Solution
To me the answer here is to use JavaScript / CSS injection pattern...but only with the classic UI. With the new UI we still need to know / learn how to do it
Highlighted

@John Aage Andersen 

 

try this in powershell

 

Get-SPOSite <SiteURL>|select DenyAddAndCustomizePages

 

- to see if its enabled. if enabled, run this:

 

Set-SPOSite <SiteURL> -DenyAddAndCustomizePages 0 

Highlighted

Agree with @Juan Carlos González Martín here.

The "Template" is referring to a page layout (basically a definition of what a page should look like).  However, as Juan mentions, you should keep your customization loosely coupled to the pages, and inject references to your CSS into the page through JavaScript. This can be done via User Custom Actions.

Highlighted

@Juan Carlos González Martín 

 

if you want to remove the message from modern sites use the powershell I provided. This was given to me from MS support and it works.