SharePoint 2010 Training Session 2

1,585 views

Published on

Published in: Technology, Education
3 Comments
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
1,585
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
51
Comments
3
Likes
0
Embeds 0
No embeds

No notes for slide

SharePoint 2010 Training Session 2

  1. 1. SharePoint 2010 Session - 2By: Usman Zafar Malik[MCTS: MOSS 2007], [MSCBSS: CRM 3.0 / 4.0], MCP
  2. 2. SharePoint 2010 Master Page Development
  3. 3. Types of Master Pages1- Application Master Pages  Deals with your custom Site Look and Feel2- System Master Pages  Deal with SharePoint System PagesCommonly used Master Pages v4.master - (New Blue Ribbon Bar, SharePoint 2010 Master Page) default.master - Sites upgraded from SharePoint 2007 use this unless they are changed to use a v4 version) minimal.master - Master page contains almost nothing. It is used by the Search Center and Office Web Applications. commonly referred to as Starter Master Pages in SharePoint 2010.
  4. 4. Mandatory PlaceholdersPlaceholder Control Description NewPlaceHolderQuickLaunchTop The top of the Quick Launch menu.PlaceHolderQuickLaunchBottom The bottom of the Quick Launch menu.PlaceHolderPageTitle The title of the site.PlaceHolderAdditionalPageHead A placeholder in the head section of the page used to add extra components such as ECMAScript (JavaScript, JScript) and Cascading Style Sheets (CSS) to the page.PlaceHolderBodyAreaClass The class of the body area.SPNavigation A control used for additional page editing controls.PlaceHolderSiteName The name of the site where the current page resides.
  5. 5. Mandatory PlaceholdersPlaceholder Control Description NewPlaceHolderPageTitleInTitleArea The title of the page, which appears in the title area on the page.PlaceHolderPageDescription The description of the current page.PlaceHolderSearchArea The section of the page for the search controls.PlaceHolderGlobalNavigation The breadcrumb control on the page.PlaceHolderTitleBreadcrumb The breadcrumb text for the breadcrumb control.PlaceHolderGlobalNavigationSite The list of subsites and sibling sites in theMap global navigation on the page.PlaceHolderTopNavBar The container used to hold the top navigation bar.
  6. 6. Mandatory PlaceholdersPlaceholder Control Description NewPlaceHolderHorizontalNav The navigation menu that is inside the top navigation bar.PlaceHolderLeftNavBarDataSource The placement of the data source used to populate the left navigation bar.PlaceHolderCalendarNavigator The date picker used when a calendar is visible on the page.PlaceHolderLeftNavBarTop The top section of the left navigation bar.PlaceHolderLeftNavBar The Quick Launch bar.PlaceHolderLeftActions The additional objects above the Quick Launch bar.PlaceHolderMain The main content of the page.
  7. 7. Mandatory PlaceholdersPlaceholder Control Description NewPlaceHolderFormDigest The container where the page form digest control is stored.PlaceHolderUtilityContent The additional content at the bottom of the page. This is outside of the form tag.PlaceHolderTitleAreaClass The class for the title area. This is now in the head tag. Any customizations that add a WebPartZone in a content tag to this placeholder will cause an error on the page.
  8. 8. Mandatory Placeholders (backward compatibility)Placeholder Control Description NewPlaceHolderPageImage This placeholder does not appear as part of the UI and must be present for backward compatibility.PlaceHolderTitleLeftBorder This placeholder does not appear as part of the UI and must be present for backward compatibility.PlaceHolderMiniConsole This placeholder does not appear as part of the UI and must be present for backward compatibility.PlaceHolderTitleRightMargin This placeholder does not appear as part of the UI and must be present for backward compatibility.
  9. 9. Mandatory Placeholders (backward compatibility)Placeholder Control Description NewPlaceHolderTitleAreaSeparator This placeholder does not appear as part of the UI and must be present for backward compatibility.PlaceHolderNavSpacer This placeholder does not appear as part of the UI and must be present for backward compatibility.PlaceHolderLeftNavBarBorder This placeholder does not appear as part of the UI and must be present for backward compatibility.PlaceHolderBodyLeftBorder This placeholder does not appear as part of the UI and must be present for backward compatibility.
  10. 10. Mandatory Placeholders (backward compatibility)Placeholder Control Description NewPlaceHolderBodyRightMargin This placeholder does not appear as part of the UI and must be present for backward compatibility.
  11. 11. Master Page in Code Behind Case<%@ Assembly Name=“DLL Name, Version=1.0.0.0, Culture=neutral,PublicKeyToken=35ea4244489a016b" %><%@ Master language="C#"Inherits=“CompleteNamespace.CodeBehind.MasterPages.CorporateMasterClass" %>
  12. 12. Master Page For Dialog Pagesclass="s4-notdlg"--------------------------------------It goes in every div that you dont want to show in a dialog box.Example: Common places would be the logo, navigation, and footer.
  13. 13. Master Page for Dialog PagesHow to Hide Top Bar, Ribbon, Quick Launch in SharePoint 2010------------------------------------------------------------------------------------------------------------------<style type="text/css"> #s4-ribbonrow, .ms-cui-topBar2, .s4-notdlg, .s4-pr s4-ribbonrowhidetitle, .s4-notdlgnoindex, #ms-cui-ribbonTopBars, #s4-titlerow, #s4-pr s4-notdlg s4-titlerowhidetitle, #s4-leftpanel-content {display:none !important;} .s4-ca{margin-left:0px !important; margin-right:0px !important;}</style>
  14. 14. Master Page CSSSpecifying CSS files------------------------------------------------------------------------------------------------------------------<link href="/Style Library/IntranetCSS/Corporate-Master.css" rel="stylesheet"type="text/css" /><Sharepoint:CssRegistration name = "<% $SPUrl:~SiteCollection/StyleLibrary/AteaIntranetCSS/MyCustomCssFile.css %>" runat="server" after="corev4.css"></Sharepoint:CssRegistration>• after=“corev4.css”  load this custom css file after this specified css file “corev4.css”• $SPUrl:~SiteCollection  Path started from Site Collection (Top Level Site)”~SiteCollection” referes to the root site of the site collection.”~Site” refers to the context of the current site which may be a sub-site also.
  15. 15. Master Page JavascriptSpecifying Script files------------------------------------------------------------------------------------------------------------------Normal Way<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>Automatically generate Script tag<asp:ScriptReference Path="<%$SPUrl:~SiteCollection/Style Library/scripts/jquery-1.5.min.js%>"></asp:ScriptReference>
  16. 16. Master Page User ControlSpecifying User Controls in Master Page------------------------------------------------------------------------------------------------------------------<%@ Register src = "~/_controltemplates/MyIntranet.Controls.UC/ucTopNav.ascx"tagname="ucTopNav" tagprefix="uc1" %>
  17. 17. Master Page Web ControlSpecifying Web Controls in Master Page------------------------------------------------------------------------------------------------------------------<%@ Register TagPrefix=“MyInranet" Namespace=“MyIntranet.Controls.WebControls"Assembly=“MyIntranet.Controls, Version=1.0.0.0, Culture=neutral,PublicKeyToken=381ced654b713b32" %>
  18. 18. Master Page Delegate ControlsDelegate Controls------------------------------------------------------------------------------------------------------------------A delegate control defines a region in an “.aspx” page that allows the content to bereplaced with our custom content. This custom content is created via a SharePointfeature, and when deployed and activated, replaces the standard content at runtimeExample: <SharePoint:DelegateControl runat=”server” ControlId=”GlobalNavigation”/> ControlId value determines what delegate control. Global Navigation bar has a ControlId value of GlobalNavigation
  19. 19. Master Page Delegate Controls
  20. 20. Master Page Delegate Controls<Control Id = “GlobalNavigation” Sequence=”90”ControlSrc=”~/_ControlTemplates/ucGlobNavDelegateControl.ascx” /> Sequence should be less than 100. The ControlSrc value indicates the location to our custom delegate control.
  21. 21. Thanks !

×