Loading...

Monday, October 22, 2012

Brand Configurable Left Navigation With WebPart

1)In SPD , create the Page from  Master Page as shown  in below image

2)Add the required namespaces  and  contentplaceholderid="PlaceHolderLeftNavBar"
In this contentplaceholderid Insert the WebPartzone.
Now ,you can configure Left Navigation On Fly,with the help of configurable webpart in this zone

<%-- _lcid="1033" _version="14.0.4762" _dal="1" --%>
<%-- _LocalBinding --%>
<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"  %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content id="Content1" runat="server" contentplaceholderid="PlaceHolderLeftNavBar">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
    <tr>
     <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" width="100%"> 
     <WebPartPages:WebPartZone runat="server" Title="loc:FullPage" ID="FullPage" FrameType="TitleBarOnly"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td>
    </tr>
    <script type="text/javascript" language="javascript">if(typeof(MSOLayout_MakeInvisibleIfEmpty) == "function") {MSOLayout_MakeInvisibleIfEmpty();}</script>
  </table>
    </asp:Content>
To add the combined configurable left navigation and QuickLaunch check this link
3)To adjust the position of main contents and quicklaunch  apply this css

<asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server">
 <style type="text/css">
#s4-leftpanel-content   
 {
    width:25%;
   float:left;
 }
 
#MSO_ContentTable
{
  width:75%;
  float:right;
}

    </style>
</asp:Content>
Note --> Above Quicklaunch will be available only for Particular Page or PageLayout
If you want to make this consistent through out the Site, You need to write the Delegate control with WebPart Zone ,check this post for creating delegate control.

No comments: