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=,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"  %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content id="Content1" runat="server" contentplaceholderid="PlaceHolderLeftNavBar">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
     <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>
    <script type="text/javascript" language="javascript">if(typeof(MSOLayout_MakeInvisibleIfEmpty) == "function") {MSOLayout_MakeInvisibleIfEmpty();}</script>
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">

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.

Thursday, October 11, 2012

Content Approval Workflow Using Reusable Workflows

A)Reusable Workflow associated with Content Type In SharePoint Designer
1)Create the Site columns(similar columns that are created after content approval is enabled on Library) and add those  Site Columns to Content type Inherited from Document Content Type

2)In Document Library , Enable the Custom Document Content type as created in above step
and delete the existing document Content Type

3)Enable the Content Approval on this Document Library
Library Settings -->Versioning-->Select allow content approval option

4)In SharePoint Designer ,In Workflows tab,create new Reusable workflow(this is only the deployable workflow , so avoid creating list workflows , If unknowingly you have created List workflow see this trick, another trick)
Associate this Workflow to Content Type (created in step1)
One more..

5)Add this workflow to  Content Type Created in Step A 1
Edit the Custom Document Content Type, in workflow Settings  , Add the workflow instance using reusable workflow template as created above.

6)Save this Reusable workflow as Template in SPD  and download the required wsp from Site assets Library

B)Deploy reusable workflow to Production site
1)Save the site as Template (Test site where content type is created and associated with workflow )and Import into Visual Studio(select site columns ,Custom Document Content type  and Document Instance while importing.
Deploy this solution on production site (or create feature dependency).

2)Upload the wsp created in step A 5 and activate the Workflow  feature .
Or (Import  as Workflow in visual studio and create dependent feature on step B 1)

3)By default Document Workflow will not be associated with Custom Content Type.
When you import Reusable workflow ,Add the feature receiver which will  associate
Custom Document Content Type with this Workflow
Download the Source
In this source ,Association and Initiations forms are removed .you can add those if required.

C)Difference in Content Approval and Approval Workflow

Note -->For association of Content Type and importing wsp to Visual Studio, you can read this post