Microsoft Office SharePoint DesignerMaster PagesHOL384Word文件下载.docx
《Microsoft Office SharePoint DesignerMaster PagesHOL384Word文件下载.docx》由会员分享,可在线阅读,更多相关《Microsoft Office SharePoint DesignerMaster PagesHOL384Word文件下载.docx(28页珍藏版)》请在冰豆网上搜索。
![Microsoft Office SharePoint DesignerMaster PagesHOL384Word文件下载.docx](https://file1.bdocx.com/fileroot1/2022-12/7/a7d7efa6-11bd-4c7a-b0a8-63ca0478f837/a7d7efa6-11bd-4c7a-b0a8-63ca0478f8371.gif)
4.Scenario
ThislabwillcoverseveraltypesofMasterPagecustomizationavailableinMicrosoftOfficeSharePointDesigner2007startingwithaddingglobalsitelinksandcopyrightinformationtoamasterpageandmovingtodesigningaMasterPagefromthegroundup.
5.PurposeofHands-onLab
ThislabwillexplainthedifferenttypesofMasterPagesthatMicrosoftOfficeSharePointDesigner2007isabletoutilize,aswellashowtodesignanewMasterPageforSharePoint.
Hands-onLab
DiscussionPoints
Actionstaken
UsingMicrosoftOfficeSharePointDesigner2007toCustomizeSharePointMasterPages
Thissectionwillcoverbasiccustomizationsofmasterpages.
Setup
∙Login,usingthefollowingcredentials:
∙Logon:
administrator
∙Password:
pass@word1
∙WaitfortheWarmupscripttocompleteandclose
AddGlobalLinkstoMasterPage
Inthissection,corporatelinkswillbeaddedtothetopnavigationbarofaSharePointsitebyeditingaMasterPage.
OfficeSharePointDesigner2007usersmaynoticethatwhentheyclickandtrytomodifycertainpartsofaWebPartpagetheyareunabletoso.ThisisbecausethatcontentisnotactuallypartoftheWebPartitisdefinedbythemasterpageitreferences.Thebasicconceptbehindmasterpagesistocreatethelayoutforanapplicationinonefile.Thelayoutdefinesspecificareas(ContentPlaceHoldercontrols)thatpagesthatusethemasterpagecanaddcontentto.TheindividualcontentpagesthenreferencethemasterpageandaddcontenttoContentcontrolswhichreferencethemasterpage’sContentPlaceHoldercontrols.Thisreducesdevelopmenttimeanderrorsbyeliminatingtheneedtoreproducethelayoutcodeoneachpage.AsitehasoneDefaultMasterPagesetting.EachSharePointsitedefinitionincludesadefault.masterfilewhichissetastheDefaultMasterPagesetting.TheindividualWebPartpagessuchasdefault.aspxandAllItems.aspxineachlistreferencethismasterpage.
InMOSSthereisanotherimportantmasterpagesetting,CustomMasterPage.TheCustomMasterPageisusedinpublishingpageslocatedinasite’sPagesdirectory.
∙InSharePointDesigner,openthesiteifitisnotalready
∙IntheFolderListtaskpane,expandthe_catalogdirectorythenexpandmasterpage(MasterPageGallery)subdirectory,doubleclickondefault.master
∙ClickYesbuttonintheCheckoutdialogifitpopsup
∙OpenaFindandReplacedialogbyhittingCRTL+F
∙IntheFindandReplacedialog,typeGlobalSiteLink2intheFindwhattextboxandclickFindNext
∙Movethecursorinfrontoftheparentclosingtrtag(<
/tr>
)oftheGlobalSiteLink2DelegateControl.TheHTMLshouldlikesimilartothis(withthetargettrtaghighlighted):
<
tdclass="
ms-globallinks"
>
SharePoint:
DelegateControlControlId="
GlobalSiteLink1"
Scope="
Farm"
runat="
server"
/>
/td>
<
GlobalSiteLink2"
∙GototheendofthelineandhitEnterbutton
∙Typeorcopy/pastethefollowingtoaddaHelpDesklink:
spanstyle='
padding-left:
3px'
/span>
ahref="
http:
//helpdesk"
HelpDesk<
/a>
4px;
padding-right:
|<
∙Theresultoftheeditshouldlooksimilartothefollowing:
tr>
∙[Optional]AddthefollowingHTMLbeforetheclosingtrtagtoaddCorporateDirectoryandTermsofUselinks
//terms"
TermsofUse<
//directory"
CorporateDirectory<
∙SavethefilebyhittingCtrl+S
∙IntheFolderListtaskpane,rightclickonAdvWorks.aspxandselectPreviewinBrowser
∙NoticethenewHelpDesklink(TermsofUseandCorporateDirectoryifstep10wascompleted)atthetopofthepage
∙Closethebrowser
AddCopyrightNoticetoMasterPage
Thissectionshowshowtoaddacopyrightnoticetothebottomofallofasite’spagesbymodifyingthesite’sdefaultmasterpage.
Thetext&
#169;
inHTMLproducescopyrightsymbol(©
).
TheaspnetisabasicSharePointTeamSite.IfSharePointPublishingfeatureswereenabled,thesite’scustommasterpagewouldalsohavetobeeditedorthenewdefault.masterpagewouldhavetobesetthecustommasterpageofthesite.
InsiteswiththeSharePointPublishingfeatureenabled(availableonMOSSservers)theDefaultandCustomMasterPagesettingscanalsobesetintheSiteMasterPageSettingspage(accessiblefromtheSiteSettingspage).Thepage’sSiteMasterPagesettingcorrespondstothesite’sCustomMasterandtheSystemMasterPagecorrespondstoDefaultMaster.Themasterpagedropdownlistsarepopulatedfromthemasterpagecataloginrootsiteofthesitecollection.
Note:
Theerrormessage“Thesitemasterpagesettingcurrentlyappliedtothissiteisinvalid.Pleaseselectanewmasterpageandapplyit”frequentlyshowsuponthispage.Itisapotentialbugandjustignoreit.
Pagesinthe_layoutsdirectorydonotreferenceDefaultorCustomMaster.Theyusespecialmasterpagesinthe_layoutsdirectory.Modifyingmasterpagesinthe_layoutsdirectoryisnotsupported.
∙IntheFolderListtaskpane
∙Rightclickondefault.masterandselectCopy
∙Rightclickonmasterpage(MasterPageGallery)andselectPaste
∙RightclickonCopyofdefault.masterandselectRename
∙Typecopyright.masterandhitEnter
∙OpentheFindandReplacedialog,byhittingCRTL+F
∙IntheFindandReplacedialog,enterPlaceHolderMainintheFindwhattextboxandclickFindNext
∙Movethecursortoafterthenextclosingtrtag(<
)andhitEnter
∙Typeorcopy/pastethefollowingtext:
td>
tableheight="
95%"
width="
100%"
ms-vb"
style="
vertical-align:
bottom;
text-align:
center"
&
#1692007Allrightsreserved.
/table>
∙Afterthechangesthesectionshouldlooksimilartothefollowing:
asp:
ContentPlaceHolderid="
PlaceHolderMain"
/asp:
ContentPlaceHolder>
/PlaceHolder>
∙SavethefilebyhittingCrtl+S
∙IntheFolderListtaskpane,rightclickcopyright.masterandselectSetasDefaultMasterPage
∙IntheFolderListtaskpane,doubleclickAdvWorks.aspx
∙IntheFolderListtaskpane,rightclickAdvWorks.aspxandselectPreviewinBrowser
∙Noticethecopyrightnoticeatthebottomofthepage
CreateaMasterPagefromaBlankMaster
Inthissectionanewmasterwillbecreatedfromablankmasterpage.
Asdiscussedearlier,SharePointmasterpagesdefineContentPlaceHoldercontrolsthatsetwherepagesinheritingthemasterpagecanaddcontent.ThemasterpagesthatyoudesignmustdeclarethesameContentPlaceHoldercontrols.Ifyourmasterpagelacksthesecontrols,youmayencountererrorswhenchildpagesattempttoaddcontenttothem.FormoreinformationabouttheContentPlaceHoldercontrolsthatmustbedeclaredinallSharePointmasterpagesvisit
Anytimethepromptwarningthatwithoutmatchingcontentregionsthechildpageswillbreakappearsdoublecheckthemasterpagebeforesettingitasthedefault.
Inthissectioncodewillbecopiedfromdefault.mastertothenewlitware.mastertospeedtheprocessandtoavoidmistakes.CopyingneededcontentfromanexistingworkingSharePointmasterpageisthemostreliableandleasterrorpronemethodforcreatinganewmasterpage.
Importantchildelements/controlsoftheheadtag.
TitleID=onetidTitle>
ContentPlaceHolderid=PlaceHolderPageTitlerunat="
/Title>
∙Thetitleelementofthepagewhichdisplaysinthetitlebarofthebrowser.ThePlaceHolderPageContentPlaceHoldercontrolisreferencedbyaContentcontrolintheinheritingpagewherethetitleisset.
CssLinkrunat="
∙Addthereferencetothecore.cssfilethathasthebasecssclassesusedinallpagesinSharePoint.Othercssfilescaneasilybeincludedwhiledefiningpages,butitisimportantthatthiscontrolremainsonthepageaschildcontrolssuchasWebPartswillstillcontinuetousecssclassesdefinedinthisfile.
Themerunat="
∙Addareferencetothecurrenttheme’scssfiletothepage.
ScriptLinklanguage="
javascript"
name="
core.js"
Defer="
true"
∙Addsreferencecore.jstothepage.Core.jscontainsSharePoint’sbasicjavascriptfunctions.
CustomJSUrlrunat="
∙Addsth