کد:
http://blogs.msdn.com/crm/archive/2006/06/20/639918.aspx
One of the key ways that you can integrate other web applications with Microsoft CRM is to use the Iframe control. When using Iframes to SharePoint Technologies pages you may want to remove the navigation and title bar chrome so that the document library has a more integrated appearance. Below are the steps I use to trim the chrome on Windows SharePoint Services v2 and SharePoint Portal Server 2003.

The first thing to do is to create a new view for your document library. By using a new view you can preserve the normal user experience when navigating the document library within SharePoint. This also provides for a tailored experience when integrated into Microsoft CRM.



Figure 1 - Sections to Remove

Note: If you use “Split View” then saving the page will show the changes.

Creating a new view


  • Navigate to the Document library
  • On the left side click “Modify settings and columns”
  • Scroll to the bottom of the settings page to the “Views” section
  • Click “Create a new view”
  • Choose “Standard View”
  • Name the view and click OK to save (I usually name the view ‘FrameView’ so that I can easily identify it later.)


Open the site in FrontPage


  • Click ‘Open Site’ from the File menu of Front page
    • If your document library is in a sub-site navigate down to the correct sub-site. (Example: http://localhost:1919/sales/ where “sales” is a sub-site )
  • Navigate to your document library in the site explorer
  • Open the “Forms” folder under the document library
  • Right click and select ‘Open’ on the view that was created above.


Find and remove the title bar frame

Now that we have the view open in FrontPage we need to find the sections to remove.

  • Change the view to Split or Code view and start at the top line.
  • Select ‘Find’ from the Edit menu and search for “ms-bannerframe”
  • This will find a “table” element with the ms-bannerframe class.
  • Select the complete tag (right click on table and click “Select Tag” is the easiest method to select the full tag)
  • Delete the selected tag (This will remove the top level navigation bar)


Moving the RelativeFolderPath property

SharePoint has an important property stored in the titlebarareaframe that we need to move to the descriptiontext section.


  • Select ‘Find’ from the Edit menu and search for “RelativeFolderPath”
  • Select the tag and “Cut” it to the clipboard

کد:
<SharePoint:ListProperty Property="RelativeFolderPath" runat="server"/>


  • Select ‘Find’ from the Edit menu and search for “ms-descriptiontext”
  • Paste it just after the “Description” property


کد:
<SharePoint:ListProperty Property="Description" runat="server"/>
<SharePoint:ListProperty Property="RelativeFolderPath" runat="server"/>
Removing the titleareaframe


  • Select ‘Find’ from the Edit menu and search for “div class="ms-titleareaframe"”
  • Select and delete the complete “ms-titleareaframe” div tag


Removing the navigation bar sections


  • Select ‘Find’ from the Edit menu and search for “class=ms-nav”
  • Select and delete the TD tag with this class.




The view now has all of the title and navigation frames removed and will work will in an Iframe. SharePoint creates a virtual page for every view so you can craft a URL that will always show you desired view. The URL is made up of the following components


  • Server
  • Sub Site
  • Document library name
  • Forms folder
  • View name

Example: http://localhost:1919/sales/Testfram...FrameView.aspx

Looking ahead, my next blog post will illustrate how to trim the chrome from a web part page. The structure is slightly different.

Rich Dickinson

















موضوعات مشابه: