Wednesday, October 6, 2010

Adding scripts or styles to SharePoint master pages

There are times you may need to add a script or a style to the <head> tag of a CGCC public or Inside webpage. In each SharePoint Master page (except CGCC-Parent.master) there is a content placeholder named 'PlaceHolderAdditionalPageHead' that looks like this.

<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" >
</asp:ContentPlaceHolder>

In your aspx layout page, add the following asp:Content control:

<asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server" >
</asp:Content>

Place the script or style in between the opening and closing tag. After saving and publishing, go to the website and verify.

No comments:

Post a Comment