Aanpassen application.master met SharePoint Designer
Nadat er eenmaal een mooie Master Page staat aan de voorkant van de SharePoint Portal, komt regelmatig de vraag of ook de achterkant wat aangepast kan worden aan de huisstijl van het bedrijf. Wat SharePoint betreft betekend dit een aanpassing aan de application.master.
De aanpassing die ik dit keer wilde doen was wel heel eenvoudig, namelijk dat de application.master altijd een site icon toonde dat in een image library stond op mijn SharePoint Portal. Niets meer dan: uitchecken master page, aanpassen van een URL, inchecken en testen. Dus dat heb ik dan ook gedaan, met SharePoint Designer. En dat was gelijk mijn fout…
SharePoint Designer verbouwd zelf ook andere onderdelen van de Master Page waar je eigenlijk helemaal niet om vraagt. In het geval van de application.master is het zelfs zo erg dat het raadplegen van een pagina met die master page consequent een ERROR gaat geven. Dus een restore van de master page is de enige oplossing.
Het is zelfs zo erg dat het openen van de application.master en direct weer opslaan (dus zonder wijziging) er al voor zorgt dat de file zodanig overhoop wordt gehaald dat je de master page kunt weggooien en restoren.
Beetje Googlen leverde mij een kort artikel op van Shane Perran. Dit zegt precies waar het op staat wat aanpassingen aan application.master en andere bestanden uit de _layouts directory van SharePoint:
SharePoint 2007, ** CAUTION ** Editing Application.Master (or any _layouts files)
This post is simply to avoid the invetiable. As time goes on more and more people will attempt edits of their application.master page as well as other pages within the _layouts directory.
Before you do be make sure you fully understand the possibile consequences, some important things to realize are listed below:
1) Microsoft does not support editing default (file system) pages, they can easily be overwritten during updates, patches etc. Please make sure everyone (This includes management, developers, customers – everyone) is aware of this.
2) SharePoint Designer 2007 can and does make automatic changes to page tokens and references which can break pages within your _layouts folder. In the event that you find yourself starting at an error after editing your application.master page in SPD, now you know why. Check the page changes (at the top of the page).
For those that have no fear and realize the potential threats editing these pages cause, please make sure you have a VERY solid back-up story and that it’s followed.
This post was mostly to point out the fact that SharePoint Designer 2007 does make automatic changes to pages without your knowledge – these changes can and do break the pages within the _layouts folder on the servers file system. Hopefully there will be options for “no automatic” code changes, or “warn before all” in the final builds.
Dus voor iedereen die met application.master aan de gang gaat. LET OP wat je doet!!!
