Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.
Showing posts with label SharePoint 2007 Designer. Show all posts
Showing posts with label SharePoint 2007 Designer. Show all posts

Tuesday, February 21, 2012

Creating a Blank Custom MasterPage with Exact Widths in SharePoint 2007

<%@Master language="C#"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">
<HEAD runat="server">
    <META Name="GENERATOR" Content="Microsoft SharePoint">
    <META Name="progid" Content="SharePoint.WebPartPage.Document">
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
    <META HTTP-EQUIV="Expires" content="0">
    <SharePoint:RobotsMetaTag runat="server"/>
    <Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
    <SharePoint:CssLink runat="server"/>
    <SharePoint:Theme runat="server"/>
    <SharePoint:ScriptLink language="javascript" name="core.js" Defer="true" runat="server"/>
    <SharePoint:CustomJSUrl runat="server"/>
    <SharePoint:SoapDiscoveryLink runat="server"/>
    <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
    <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
    <style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
}
-->
</style>
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
  <form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
    <WebPartPages:SPWebPartManager id="m" runat="Server"/>
       

   
   
   
   
   
    <asp:ContentPlaceHolder ID="WSSDesignConsole" runat="server">
        <wssuc:DesignModeConsole id="IdDesignModeConsole" runat="server"/>
    </asp:ContentPlaceHolder>
    <asp:ContentPlaceHolder ID="SPNavigation" runat="server">
    <SharePoint:DelegateControl runat="server" ControlId="PublishingConsole"
       PrefixHtml="&lt;tr&gt;&lt;td colspan=&quot;4&quot; id=&quot;mpdmconsole&quot; class=&quot;ms-consolemptablerow&quot;&gt;"
       SuffixHtml="&lt;/td&gt;&lt;/tr&gt;">
    </SharePoint:DelegateControl>
    </asp:ContentPlaceHolder>
     <TABLE  CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" HEIGHT="100%" style="border:#b3b3b3 1px solid;">
    <TR height="100%"><TD align="center" ><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" HEIGHT="100%">
   

    <TR>
     
     
      <td  valign="top">
        <PlaceHolder id="MSO_ContentDiv" runat="server">
        <table id="MSO_ContentTable" align="center" width=100% height="100%" border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet">
        <tr>
        <td>
        <!--Need to copy the HTML Conent given by Designer Here
        -->
        </td>
        </tr>
          <tr id="trBreadCrum">
        <td valign="top" class="ms-titlearea" id="tdBreadCrum">
         &nbsp;&nbsp;<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
            <asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/> &nbsp;
         </asp:ContentPlaceHolder>
        </td>
       </tr>
          <tr>
             <td  width=100% height="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
               <A name="mainContent"></A>               
                <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
                </asp:ContentPlaceHolder>
             </td>
          </tr>
        </table>
        </PlaceHolder>
      </td>
     
    </TR>
    <tr>
    <td><!-- Need to copy the Footer Part Here--></td>
  </tr>
    </TABLE></TD></TR>
  </TABLE>
 
  <!--Hiding Place Holders-->
  <div style="display: none">
    <asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"/>
        <asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server" >
            </asp:ContentPlaceHolder>
            <asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server" >
                </asp:ContentPlaceHolder>
                <asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" >
                    </asp:ContentPlaceHolder>
                    <asp:ContentPlaceHolder id="PlaceHolderMiniConsole" runat="server" >
                        </asp:ContentPlaceHolder>
                        <asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" runat="server" >
                            </asp:ContentPlaceHolder>
                            <asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server" >
                                </asp:ContentPlaceHolder>
                                <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarDataSource" runat="server" >
                                    </asp:ContentPlaceHolder>
                                    <asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server" >
                                        </asp:ContentPlaceHolder>
                                        <asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server" >
                                            </asp:ContentPlaceHolder>
                                            <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarBorder" runat="server" >
                                                </asp:ContentPlaceHolder>
                                                <asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server" >
                                                    </asp:ContentPlaceHolder>
                                                    <asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" >
                                                        </asp:ContentPlaceHolder>
                                                        <asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat="server" >
                                                            </asp:ContentPlaceHolder>
                                                            <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarTop" runat="server" >
                                                                </asp:ContentPlaceHolder>
                                                                <asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server" >
                                                                    </asp:ContentPlaceHolder>
                                                                    <asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
    </asp:ContentPlaceHolder>
                                                                    <div>
                                                                        <span id="TurnOffAccessibility" style="display: none">
                                                                        <a href="#" class="ms-acclink" onclick="SetIsAccessibilityFeatureEnabled(false);UpdateAccessibilityUI();return false;">
                                                                        <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnoffaccessibility%>" EncodeMethod="HtmlEncode"/>
                                                                        </a>
                                                                        </span>
                                                                        <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server">
              </asp:ContentPlaceHolder>
                                                                    </div>
                                                                    <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server">
        <table CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%">
        <tr>
         <td colspan=4 class="ms-globalbreadcrumb">
            <span id="TurnOnAccessibility" style="display:none">
               <a href="#" class="ms-skip" onclick="SetIsAccessibilityFeatureEnabled(true);UpdateAccessibilityUI();return false;">
            <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,master_turnonaccessibility%>" EncodeMethod="HtmlEncode"/></a>
            </span>
            <A href="javascript:;" onclick="javascript:this.href='#mainContent';" class="ms-skip" AccessKey="<%$Resources:wss,maincontent_accesskey%>" runat="server">
            <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,mainContentLink%>" EncodeMethod="HtmlEncode"/></A>
   
            </td>
           </tr>
           <tr style="display:none;">
           <td>
           <asp:LoginName runat="server" id="LoginName1"></asp:LoginName>
           </td>
           </tr>
       </table>
   
<p>&nbsp;</p>

      </asp:ContentPlaceHolder>
                                                                    <asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
            </asp:ContentPlaceHolder>
                                                                    <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
   
                    <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
                <SharePoint:delegatecontrol runat="server" ControlId="SmallSearchInputBox"/>
          </asp:ContentPlaceHolder>
           
        </asp:ContentPlaceHolder>
                                                                </div>
 
 
 
 
 
 
  <asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
        <SharePoint:FormDigest runat=server/>
  </asp:ContentPlaceHolder>
   <input type="text" name="__spDummyText1" style="display:none;" size=1/><input type="text" name="__spDummyText2" style="display:none;" size=1/></form>
  <asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
    <asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
    <asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>
</BODY>
</HTML>

Friday, January 13, 2012

SharePoint Designer 2007 Licenced Version not working in Windows Server 2003 R2 Terminal Server

If your SharePoint Designer 2007 is a licensed version then it will not work in Windows Server 2003 R2 Terminal Server. For this you have to download the free version of SharePoint Designer 2007.
 Download the free SharePoint Designer 2007 Here.

Monday, December 05, 2011

Getting Current Page Url using xslt.

<%@ Page language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" masterpagefile="~masterurl/default.master" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content id="Content1" runat="Server" contentplaceholderid="PlaceHolderMain">
<script language="javascript" type="text/javascript">
function getLinkDynamic()
{
 var strUrl="/{@FileRef}/DispForm.aspx?ID={@ID}&Source=window.location.href";
 return strUrl
}
</script>
    <WebPartPages:SPProxyWebPartManager runat="server" id="ProxyWebPartManager">
    </WebPartPages:SPProxyWebPartManager>
    <table style="width: 100%">
        <tr>
            <td>
            <WebPartPages:WebPartZone id="g_946A9FBBB7644CEFB36BBE70340D9A15" runat="server" title="Zone 1"><ZoneTemplate>
            <WebPartPages:DataFormWebPart runat="server" SuppressWebPartChrome="False" Description="" PartImageSmall="" DataSourceID="" MissingAssembly="Cannot import this Web Part." ListName="{53175A92-E6CC-4464-8E5C-9C23436D0577}" FrameType="None" ConnectionID="00000000-0000-0000-0000-000000000000" DetailLink="" ExportControlledProperties="True" IsVisible="True" AllowRemove="False" AllowEdit="False" ID="g_6b7417ff_0b73_40ae_84bc_152313e9a2cd" Dir="Default" FrameState="Normal" DisplayName="Test" ViewContentTypeId="" AllowClose="False" AllowConnect="False" PageSize="-1" Default="FALSE" AllowMinimize="False" IsIncludedFilter="" ShowWithSampleData="False" ChromeType="None" HelpMode="Modeless" ExportMode="All" ViewFlag="0" Title="Test" HelpLink="" AllowHide="False" AllowZoneChange="False" PartOrder="1" UseSQLDataSourcePaging="True" PartImageLarge="" IsIncluded="True" NoDefaultStyle="TRUE" __MarkupType="vsattributemarkup" __WebPartId="{F3F8B212-E809-47FE-952C-E01E98F22F81}" __AllowXSLTEditing="true" WebPart="true" Height="" Width=""><DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;/View&gt;" UseInternalName="True" ID="Test1"><SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{53175A92-E6CC-4464-8E5C-9C23436D0577}" Name="ListID"></WebPartPages:DataFormParameter>
</SelectParameters><UpdateParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{53175A92-E6CC-4464-8E5C-9C23436D0577}" Name="ListID"></WebPartPages:DataFormParameter>
</UpdateParameters><InsertParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{53175A92-E6CC-4464-8E5C-9C23436D0577}" Name="ListID"></WebPartPages:DataFormParameter>
</InsertParameters><DeleteParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{53175A92-E6CC-4464-8E5C-9C23436D0577}" Name="ListID"></WebPartPages:DataFormParameter>
</DeleteParameters>
</SharePoint:SPDataSource>
</DataSources>
<ParameterBindings>
             <ParameterBinding Name="ListID" Location="None" DefaultValue="{53175A92-E6CC-4464-8E5C-9C23436D0577}"/>
             <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
             <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
             <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
             <ParameterBinding Name="url_PATH_INFO" Location="ServerVariable(PATH_INFO)" DefaultValue=""/>
             <ParameterBinding Name="url_HTTP_HOST" Location="ServerVariable(HTTP_HOST)" DefaultValue=""/>
            </ParameterBindings>
<DataFields>@Title,Title;@Description,Description;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;</DataFields>
<Xsl>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:param name="url_PATH_INFO" />
<xsl:param name="url_HTTP_HOST" />
<xsl:variable name="CurrentPageUrl" select="concat('http://',$url_HTTP_HOST,$url_PATH_INFO)" />
 <xsl:output method="html" indent="no"/>
 <xsl:decimal-format NaN=""/>
 <xsl:param name="dvt_apos">'</xsl:param>
 <xsl:variable name="dvt_1_automode">0</xsl:variable>
 <xsl:template match="/">
  <xsl:call-template name="dvt_1"/>
 </xsl:template>
 <xsl:template name="dvt_1">
  <xsl:variable name="dvt_StyleName">Table</xsl:variable>
  <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
  <table border="0" width="100%" cellpadding="2" cellspacing="0">
   <tr valign="top">
    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
     <th class="ms-vh" width="1%" nowrap="nowrap"></th>
    </xsl:if>
    <th class="ms-vh" nowrap="nowrap">Title</th>
    <th class="ms-vh" nowrap="nowrap">Description</th>
   </tr>
   <xsl:call-template name="dvt_1.body">
    <xsl:with-param name="Rows" select="$Rows"/>
   </xsl:call-template>
  </table>
 </xsl:template>
 <xsl:template name="dvt_1.body">
  <xsl:param name="Rows"/>
  <xsl:for-each select="$Rows">
   <xsl:call-template name="dvt_1.rowview"/>
  </xsl:for-each>
 </xsl:template>
 <xsl:template name="dvt_1.rowview">
  <tr>
   <xsl:if test="position() mod 2 = 1">
    <xsl:attribute name="class">ms-alternating</xsl:attribute>
   </xsl:if>
   <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
    <td class="ms-vb" width="1%" nowrap="nowrap">
     <span ddwrt:amkeyfield="ID" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(@ID))" ddwrt:ammode="view"></span>
    </td>
   </xsl:if>
   <td class="ms-vb">
    <a href="/{@FileDirRef}/DispForm.aspx?ID={@ID}&amp;Source={$CurrentPageUrl}" target="_blank"><xsl:value-of select="@Title" /></a></td>
   <td class="ms-vb">
    <xsl:value-of select="@Description"/>
   </td>
  </tr>
 </xsl:template>
</xsl:stylesheet> </Xsl>
</WebPartPages:DataFormWebPart>
</ZoneTemplate></WebPartPages:WebPartZone></td>
        </tr>
    </table>
</asp:Content>