Archives

Opening SharePoint Links in a new windowUse SHIFT+ENTER to open the menu (new window).
Mail Enabled Lists vs. The Missing Windows 2008 POP3/IMAP Server Use SHIFT+ENTER to open the menu (new window).
7 Tools for SharePoint DevelopersUse SHIFT+ENTER to open the menu (new window).
Public Facing Masterpage TechniquesUse SHIFT+ENTER to open the menu (new window).
How to Quickly Deploy and Activate a Timer Service to Your Site CollectionUse SHIFT+ENTER to open the menu (new window).
Custom SharePoint Master Page Feature with WSP BuilderUse SHIFT+ENTER to open the menu (new window).
Date Math with InfoPathUse SHIFT+ENTER to open the menu (new window).
Enterprise Search Tricks and Tips Part 1Use SHIFT+ENTER to open the menu (new window).
Populating Word Documents With SharePoint Data. Try The DIP!Use SHIFT+ENTER to open the menu (new window).
Programmatic Deep Dive into Blank SharePoint Lookup ColumnsUse SHIFT+ENTER to open the menu (new window).
SPQuery Hacks Part 1: InfoPathUse SHIFT+ENTER to open the menu (new window).
Adventures in Excel Services 2010Use SHIFT+ENTER to open the menu (new window).
What Is The Easiest Way To Mess Up SharePoint? Use SHIFT+ENTER to open the menu (new window).
Redirect SharePoint Navigation - NYC SDUG Quick DipUse SHIFT+ENTER to open the menu (new window).
SPQuery Hacks Part 2: WorkflowsUse SHIFT+ENTER to open the menu (new window).
Upgrading SharePoint 2007 RTM to SharePoint 2010 Use SHIFT+ENTER to open the menu (new window).
Using JQuery to add charts to your Data ViewsUse SHIFT+ENTER to open the menu (new window).
Quick Rundown: Multi-line Text ColumnsUse SHIFT+ENTER to open the menu (new window).
Document Previews Won’t Open In FAST Search Using HTTPSUse SHIFT+ENTER to open the menu (new window).
Sleazy Reporting: SharePoint 2010 ListsUse SHIFT+ENTER to open the menu (new window).
Helpful Debugging with SharePoint C Sharp CodeUse SHIFT+ENTER to open the menu (new window).
Public Facing Masterpage Techniques

By: Neil Barkhina

Everyone knows that SharePoint is a great platform for Intranets. But more and more people are starting to use it for its excellent Web Content Management features. When using SharePoint to create a public facing site, the typical strategy is to approach it as a vanilla ASP .NET Application. However, there are certain techniques that I have learned over the years which have helped me incorporate that balance between traditional ASP .NET and the out of the box SharePoint feature set. I would like to highlight 3 of those techniques below.


Datasheet View Background Color

Many websites tend to have a solid background color, which usually has a CSS class like Body { background-color: Some Color; } in their HTML. One thing you may have noticed is that whatever color you set as your background is the color that your datasheet view will take on. So if you are using a color other than white, especially a dark shade, this makes the Datasheet quite unreadable and very difficult to use. The way I fix this is with a short snippet of Javascript on my Master Page. The basic idea is we are reading the URL of the site into a variable. When viewing Datasheet mode, SharePoint appends the String "ShowInGrid" to your query string. If the URL contains this string we output a Style tag and set the background to white. Just make sure you put this Javascript further down in your HTML than your main CSS links. This is because browsers process style in order of sequence. Here is code snippet:

<script type="text/javascript">

 

fullURL = parent.document.URL

var bodyfix = "<style type=\"text/css\">.body{ background-color:#FFFFFF; }</style>";

 

if (fullURL.indexOf("ShowInGrid")!=-1)

    document.write(bodyfix);

 

 

</script>

 

Disabling Name.DLL ActiveX Message

This is one that many folks have faced in the past. SharePoint 2007 has integration with OCS. Whenever a People or Groups Column appears in SharePoint, you get presence information in the form of a bubble about whether they are online or not. The way this is accomplished is using a particular ActiveX control called Name.DLL. While this is great functionality, the problem is when you have a public facing site where Presence technology has no value. The last thing you'd want is to burden your users with a Security Prompt asking them to install some strange DLL (this could be quite the turn off for people if you are trying to drive traffic to your website).

The way to fix this is to find the place in your Masterpage where you are including the init.js file. Delete this line in your Masterpage and replace in with a custom JavaScript file that overrides the Name.DLL include. For a copy of this JavaScript file, you may download it from the following link:

http://www.gig-werks.com/custom_activex_override.js

 

Hidden ContentPlaceHolders

Finally, one of the most important aspects of adapting a SharePoint Masterpage to the public facing world is to know which contentplaceholders to hide. There are several versions of the so called "minimal master page" floating around the web. The one I use has been created out of sheer trial and error. It serves as a good balance for what tends to mess with Public Facing sites while still maintaining the SharePoint functionality you need such as the Page Editing Toolbar and the Quick launch. Enjoy:

<asp:Panel visible="false" runat="server">

<input type="text" name="__spDummyText1" style="display:none;" size=1/>

<input type="text" name="__spDummyText2" style="display:none;" size=1/>    

<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>

     <asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>

     <asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>

    <asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">

            <SharePointWebControls:FormDigest runat="server" />

        </asp:ContentPlaceHolder>

<asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" />

<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/>

<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"/>

<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/>

<asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server"/>

<asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server"/>

<asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server"/>

<asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server"/>

<asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server"/>

<asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat ="server" />

<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat ="server"/>

<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat ="server"/>

<asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" />

<asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" runat="server" />

<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server"/>

<asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server"/>

</asp:Panel>

-Neil Barkhina

        

Comments

There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Your Name *


e-mail address *


Website (optional)


Comment *


Attachments

 Subscribe

  GigWerks RSS  Gig Werks Mailing List 

 Contact Us

 Connect

 Resources

  SharePoint Resources
  Business Intelligence Resources
  Upcoming Webinars



©2009 Gig Werks. All rights reserved. Privacy Policy