1、4. Scenario This lab will cover several types of Master Page customization available in Microsoft Office SharePoint Designer 2007 starting with adding global site links and copyright information to a master page and moving to designing a Master Page from the ground up. 5. Purpose of Hands-on LabThis
2、 lab will explain the different types of Master Pages that Microsoft Office SharePoint Designer 2007 is able to utilize, as well as how to design a new Master Page for SharePoint.Hands-on Lab Discussion PointsActions takenUsing Microsoft Office SharePoint Designer 2007 to Customize SharePoint Master
3、 Pages This section will cover basic customizations of master pages. Setup Log in, using the following credentials: Logon: administrator Password: password1 Wait for the Warmup script to complete and closeAdd Global Links to Master PageIn this section, corporate links will be added to the top naviga
4、tion bar of a SharePoint site by editing a Master Page.Office SharePoint Designer 2007 users may notice that when they click and try to modify certain parts of a Web Part page they are unable to so. This is because that content is not actually part of the Web Part it is defined by the master page it
5、 references. The basic concept behind master pages is to create the layout for an application in one file. The layout defines specific areas (ContentPlaceHolder controls) that pages that use the master page can add content to. The individual content pages then reference the master page and add conte
6、nt to Content controls which reference the master pages ContentPlaceHolder controls. This reduces development time and errors by eliminating the need to reproduce the layout code on each page. A site has one Default Master Page setting. Each SharePoint site definition includes a default.master file
7、which is set as the Default Master Page setting. The individual Web Part pages such as default.aspx and AllItems.aspx in each list reference this master page. In MOSS there is another important master page setting, Custom Master Page. The Custom Master Page is used in publishing pages located in a s
8、ites Pages directory. In SharePoint Designer, open the site if it is not already In the Folder List task pane, expand the _catalog directory then expand masterpage (Master Page Gallery) sub directory, double click on default.master Click Yes button in the Checkout dialog if it pops up Open a Find an
9、d Replace dialog by hitting CRTL + F In the Find and Replace dialog, type GlobalSiteLink2 in the Find what textbox and click Find Next Move the cursor in front of the parent closing tr tag () of the GlobalSiteLink2 DelegateControl. The HTML should like similar to this (with the target tr tag highlig
10、hted):SharePoint:DelegateControl ControlId=GlobalSiteLink1 Scope=Farm runat=server/td a href=http:/helpdeskHelp Desk 4px; padding-right:| Optional Add the following HTML before the closing tr tag to add Corporate Directory and Terms of Use links/termsTerms of Use/directoryCorporate Directory Save th
11、e file by hitting Ctrl + S In the Folder List task pane, right click on AdvWorks.aspx and select Preview in Browser Notice the new Help Desk link (Terms of Use and Corporate Directory if step 10 was completed) at the top of the page Close the browserAdd Copyright Notice to Master PageThis section sh
12、ows how to add a copyright notice to the bottom of all of a sites pages by modifying the sites default master page.The text © in HTML produces copyright symbol ().The aspnet is a basic SharePoint Team Site. If SharePoint Publishing features were enabled, the sites custom master page would also
13、have to be edited or the new default.master page would have to be set the custom master page of the site. In sites with the SharePoint Publishing feature enabled (available on MOSS servers) the Default and Custom Master Page settings can also be set in the Site Master Page Settings page (accessible
14、from the Site Settings page). The pages Site Master Page setting corresponds to the sites Custom Master and the System Master Page corresponds to Default Master. The master page drop down lists are populated from the master page catalog in root site of the site collection.Note: The error message “Th
15、e site master page setting currently applied to this site is invalid. Please select a new master page and apply it” frequently shows up on this page. It is a potential bug and just ignore it.Pages in the _layouts directory do not reference Default or Custom Master. They use special master pages in t
16、he _layouts directory. Modifying master pages in the _layouts directory is not supported. In the Folder List task pane Right click on default.master and select Copy Right click on masterpage (Master Page Gallery) and select Paste Right click on Copy of default.master and select Rename Type copyright
17、.master and hit Enter Open the Find and Replace dialog, by hitting CRTL + F In the Find and Replace dialog, enter PlaceHolderMain in the Find what textbox and click Find Next Move the cursor to after the next closing tr tag (table height=95% width=100%ms-vb style=vertical-align:bottom; text-align:ce
18、nter © 2007 All rights reserved./table After the changes the section should look similar to the following:asp:ContentPlaceHolder id=PlaceHolderMain/asp:ContentPlaceHolder/PlaceHolder Save the file by hitting Crtl + S In the Folder List task pane, right click copyright.master and select Set as De
19、fault Master Page In the Folder List task pane, double click AdvWorks.aspx In the Folder List task pane, right click AdvWorks.aspx and select Preview in Browser Notice the copyright notice at the bottom of the pageCreate a Master Page from a Blank MasterIn this section a new master will be created f
20、rom a blank master page.As discussed earlier, SharePoint master pages define ContentPlaceHolder controls that set where pages inheriting the master page can add content. The master pages that you design must declare the same ContentPlaceHolder controls. If your master page lacks these controls, you
21、may encounter errors when child pages attempt to add content to them. For more information about the ContentPlaceHolder controls that must be declared in all SharePoint master pages visit Anytime the prompt warning that without matching content regions the child pages will break appears double check
22、 the master page before setting it as the default.In this section code will be copied from default.master to the new litware.master to speed the process and to avoid mistakes. Copying needed content from an existing working SharePoint master page is the most reliable and least error prone method for
23、 creating a new master page.Important child elements/controls of the head tag.Title ID=onetidTitleContentPlaceHolder id=PlaceHolderPageTitle runat=/Title The title element of the page which displays in the title bar of the browser. The PlaceHolderPage ContentPlaceHolder control is referenced by a Co
24、ntent control in the inheriting page where the title is set.CssLink runat= Add the reference to the core.css file that has the base css classes used in all pages in SharePoint. Other css files can easily be included while defining pages, but it is important that this control remains on the page as c
25、hild controls such as Web Parts will still continue to use css classes defined in this file.Theme runat= Add a reference to the current themes css file to the page. ScriptLink language=javascript name=core.js Defer=true Adds reference core.js to the page. Core.js contains SharePoints basic javascript functions.CustomJSUrl runat= Adds th
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1