Posted By

rumremix on 07/30/10


Tagged

sharepoint-2010 site-actions-menu welcome-link


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jlaws0n


sharepoint 2010 site actions and welcome link taming code


 / Published in: CSS
 

Both master page code and css included here. If adding master page code to a master page, remove other instances of any controls that already exist on the master page. Also included here is css for just ie7 as it renders differently than ie8 and other browsers. place this code in a file called ie7.css and link to it via\r\n\r\n\r\n\r\n\r\nin the master page.

  1. <!-- master page code starts here -->
  2.  
  3.  
  4.  
  5.  
  6. <%-- ===== Start Header ============================================================ --%>
  7.  
  8.  
  9. <div id="headerwrap-outer"><div id="headerwrap">
  10.  
  11. <%-- id="mso_contentdiv" required, helps SharePoint put the web part editing pane in the main body on the right, you can move the ID if needed --%>
  12. <div id="MSO_ContentDiv" runat="server">
  13.  
  14. <%-- link back to homepage, SiteLogoImage gets replaced by the Site Icon, you can hard code this so that its not overridden by the Site Icon or even remove --%>
  15. <div class="s4-notdlg"><%-- NOTE: any time you see s4-notdlg, this element will be hidden from SharePoint dialog windows --%>
  16. <SharePoint:SPLinkButton runat="server" NavigateUrl="~sitecollection/">
  17. <SharePoint:SiteLogoImage LogoImageUrl="/Style Library/custom/logo.png" runat="server"/>
  18. </SharePoint:SPLinkButton>
  19. </div>
  20.  
  21.  
  22.  
  23. <%-- this control is more navigation for mysites, otherwise it is empty --%>
  24. <SharePoint:DelegateControl runat="server" ControlId="GlobalNavigation"/>
  25.  
  26. <div id="wel-si" class="s4-notdlg"><div id="welcel">
  27.  
  28. <%-- Welcome / Login control --%>
  29. <%--<div class="s4-trc-container-menu">
  30. <div>--%>
  31. <wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false">
  32. </wssuc:Welcome>
  33. <%-- MultiLingual User Interface menu --%>
  34. <wssuc:MUISelector ID="IdMuiSelector" runat="server"/>
  35. <%--</div>
  36. </div>--%>
  37.  
  38.  
  39. </div><div id="sacel">
  40.  
  41.  
  42.  
  43. <%-- site actions --%>
  44. <span class="ms-siteactionsmenu" id="siteactiontd">
  45. <SharePoint:SiteActions runat="server" accesskey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenuMain"
  46. PrefixHtml=""
  47. SuffixHtml=""
  48. MenuNotVisibleHtml="&amp;nbsp;">
  49. <CustomTemplate>
  50. <SharePoint:FeatureMenuTemplate runat="server"
  51. FeatureScope="Site"
  52. Location="Microsoft.SharePoint.StandardMenu"
  53. GroupId="SiteActions"
  54. UseShortId="true"
  55. >
  56. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditPage"
  57. Text="<%$Resources:wss,siteactions_editpage%>"
  58. Description="<%$Resources:wss,siteactions_editpagedescriptionv4%>"
  59. ImageUrl="/_layouts/images/ActionsEditPage.png"
  60. MenuGroupId="100"
  61. Sequence="110"
  62. ClientOnClickNavigateUrl="javascript:ChangeLayoutMode(false);"
  63. />
  64. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_TakeOffline"
  65. Text="<%$Resources:wss,siteactions_takeoffline%>"
  66. Description="<%$Resources:wss,siteactions_takeofflinedescription%>"
  67. ImageUrl="/_layouts/images/connecttospworkspace32.png"
  68. MenuGroupId="100"
  69. Sequence="120"
  70. />
  71. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_CreatePage"
  72. Text="<%$Resources:wss,siteactions_createpage%>"
  73. Description="<%$Resources:wss,siteactions_createpagedesc%>"
  74. ImageUrl="/_layouts/images/NewContentPageHH.png"
  75. MenuGroupId="200"
  76. Sequence="210"
  77. UseShortId="true"
  78. ClientOnClickScriptContainingPrefixedUrl="if (LaunchCreateHandler('Page')) { OpenCreateWebPageDialog('~site/_layouts/createwebpage.aspx') }"
  79. PermissionsString="AddListItems, EditListItems"
  80. PermissionMode="All" />
  81. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_CreateDocLib"
  82. Text="<%$Resources:wss,siteactions_createdoclib%>"
  83. Description="<%$Resources:wss,siteactions_createdoclibdesc%>"
  84. ImageUrl="/_layouts/images/NewDocLibHH.png"
  85. MenuGroupId="200"
  86. Sequence="220"
  87. UseShortId="true"
  88. ClientOnClickScriptContainingPrefixedUrl="if (LaunchCreateHandler('DocLib')) { GoToPage('~site/_layouts/new.aspx?FeatureId={00bfea71-e717-4e80-aa17-d0c71b360101}&amp;ListTemplate=101') }"
  89. PermissionsString="ManageLists"
  90. PermissionMode="Any"
  91. VisibilityFeatureId="00BFEA71-E717-4E80-AA17-D0C71B360101" />
  92. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_CreateSite"
  93. Text="<%$Resources:wss,siteactions_createsite%>"
  94. Description="<%$Resources:wss,siteactions_createsitedesc%>"
  95. ImageUrl="/_layouts/images/newweb32.png"
  96. MenuGroupId="200"
  97. Sequence="230"
  98. UseShortId="true"
  99. ClientOnClickScriptContainingPrefixedUrl="if (LaunchCreateHandler('Site')) { STSNavigate('~site/_layouts/newsbweb.aspx') }"
  100. PermissionsString="ManageSubwebs,ViewFormPages"
  101. PermissionMode="All" />
  102. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create"
  103. Text="<%$Resources:wss,siteactions_create%>"
  104. Description="<%$Resources:wss,siteactions_createdesc%>"
  105. MenuGroupId="200"
  106. Sequence="240"
  107. UseShortId="true"
  108. ClientOnClickScriptContainingPrefixedUrl="if (LaunchCreateHandler('All')) { STSNavigate('~site/_layouts/create.aspx') }"
  109. PermissionsString="ManageLists, ManageSubwebs"
  110. PermissionMode="Any" />
  111. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_ViewAllSiteContents"
  112. Text="<%$Resources:wss,quiklnch_allcontent%>"
  113. Description="<%$Resources:wss,siteactions_allcontentdescription%>"
  114. ImageUrl="/_layouts/images/allcontent32.png"
  115. MenuGroupId="300"
  116. Sequence="302"
  117. UseShortId="true"
  118. ClientOnClickNavigateUrl="~site/_layouts/viewlsts.aspx"
  119. PermissionsString="ViewFormPages"
  120. PermissionMode="Any" />
  121. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditSite"
  122. Text="<%$Resources:wss,siteactions_editsite%>"
  123. Description="<%$Resources:wss,siteactions_editsitedescription%>"
  124. ImageUrl="/_layouts/images/SharePointDesigner32.png"
  125. MenuGroupId="300"
  126. Sequence="304"
  127. UseShortId="true"
  128. ClientOnClickScriptContainingPrefixedUrl="EditInSPD('~site/',true);"
  129. PermissionsString="AddAndCustomizePages"
  130. PermissionMode="Any"
  131. />
  132. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_SitePermissions"
  133. Text="<%$Resources:wss,people_sitepermissions%>"
  134. Description="<%$Resources:wss,siteactions_sitepermissiondescriptionv4%>"
  135. ImageUrl="/_layouts/images/Permissions32.png"
  136. MenuGroupId="300"
  137. Sequence="310"
  138. UseShortId="true"
  139. ClientOnClickNavigateUrl="~site/_layouts/user.aspx"
  140. PermissionsString="EnumeratePermissions"
  141. PermissionMode="Any" />
  142. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings"
  143. Text="<%$Resources:wss,settings_pagetitle%>"
  144. Description="<%$Resources:wss,siteactions_sitesettingsdescriptionv4%>"
  145. ImageUrl="/_layouts/images/settingsIcon.png"
  146. MenuGroupId="300"
  147. Sequence="320"
  148. UseShortId="true"
  149. ClientOnClickNavigateUrl="~site/_layouts/settings.aspx"
  150. PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData"
  151. PermissionMode="Any" />
  152. <SharePoint:MenuItemTemplate runat="server" id="MenuItem_CommitNewUI"
  153. Text="<%$Resources:wss,siteactions_commitnewui%>"
  154. Description="<%$Resources:wss,siteactions_commitnewuidescription%>"
  155. ImageUrl="/_layouts/images/visualupgradehh.png"
  156. MenuGroupId="300"
  157. Sequence="330"
  158. UseShortId="true"
  159. ClientOnClickScriptContainingPrefixedUrl="GoToPage('~site/_layouts/prjsetng.aspx')"
  160. PermissionsString="ManageWeb"
  161. PermissionMode="Any"
  162. ShowOnlyIfUIVersionConfigurationEnabled="true" />
  163. </SharePoint:FeatureMenuTemplate>
  164. </CustomTemplate>
  165. </SharePoint:SiteActions></span>
  166.  
  167.  
  168.  
  169.  
  170. </div>
  171.  
  172. <div><a href="#">Custom Link 1</a></div>
  173. <div><a href="#">Custom Link 2</a></div>
  174.  
  175. <div class="searchCell"> <%-- search box loads from delegate, style with CSS --%>
  176.  
  177. <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
  178. <SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4"/>
  179. </asp:ContentPlaceHolder>
  180.  
  181. </div >
  182.  
  183.  
  184.  
  185. </div ><%-- /#wel-si --%>
  186. <div class="clear"></div></div><%-- /#headerwrap --%></div> <%-- /#headerwrap-outer --%>
  187.  
  188.  
  189. <%-- ===== End Header ============================================================ --%>
  190.  
  191.  
  192.  
  193.  
  194. <!-- end master page code -->
  195.  
  196. <style type ="text/css">
  197.  
  198. /********************* start css ***************************/
  199.  
  200. /* ================================ @header ========================================*/
  201. /************** welcome and site actions area ***************************/
  202. #headerwrap { position:relative;}
  203. #wel-si {position:absolute; right:0px; top:10px; display:table-row;}
  204. #wel-si > div {display:table-cell; vertical-align: top;}
  205. #wel-si * { margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0;}
  206. .ms-SpLinkButtonActive, .ms-siteactionsmenuinner, .ms-siteactionsmenuhover {background:none !important; border:none; height:auto;}
  207. .ms-siteactionsmenuinner, .ms-siteactionsmenuhover, .ms-welcomeMenu {font-family: Helvetica, Arial, sans-serif !important ;}
  208. .s4-trc-container-menu, .ms-welcomeMenu, .ms-siteactionsmenu > span > a > span {margin:0; padding:0; border:none;}
  209. .ms-siteactionsmenuinner, .ms-siteactionsmenuhover {padding-top:0;}
  210. .ms-siteactionsmenuinner, .ms-siteactionsmenuhover, .ms-siteactionsmenuinner a, .ms-siteactionsmenu > span > a, .ms-welcomeMenu a:link, .ms-welcomeMenu.ms-SpLinkButtonActive a:link, #wel-si > div a, #wel-si > div a:link
  211. {color:#999999; font-size:10px;}
  212. .ms-menu-a img {/*see @hidden */}
  213. .searchCell {padding-right:17px;}
  214. </style>

Report this snippet  

You need to login to post a comment.