Category Archives: Design

Hiding the SharePoint Ribbon from Anonymous Users

Working on a couple of public-facing 2010 sites hiding the ribbon has become an issue in each of them (I’ve noticed several public-facing 2010 sites that don’t hide the ribbon, but that’s not an option if you want a clean brand). Searching for the solutions turned up a couple of solutions, but neither solution in itself turned out to be the best option.

Searching I found this Technet forum post. In that solution it is a complete CSS solution using a control detecting anonymous and logged-in users. This solution works just fine, but I wasn’t happy with simply hiding the ribbon. If I didn’t need the ribbon why waste all that load time and HTTP requests to load it only to hide it?

This led me to look for another solution, and I found another one that used security trimmed controls to not load the ribbon if not logged in. This was great! I was excited until I logged out to test, and I then realized the vertical scrollbar was hidden. The reason for this is because SharePoint 2010 hides the vertical scrollbar and adds in a custom scrollbar to stick the ribbon to the top. When you hide the ribbon the scrollbar doesn’t show because SharePoint uses overflow: hidden; in CSS for the body so it can handle the scrollbar.

The Hybrid Approach

This led to take both of them to construct the best solution. I used the security trimmed control to hide the ribbon, and then I used the control from the forum post and modified the CSS to handle the scrollbar. Here are the steps combining both of the solutions and including my addition.

1. Add the following before the start of the ribbon.

<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="AddDelPrivateWebParts">

The ribbon starts with the following HTML.

<div id="s4-ribbonrow">

2. Then close the security trimmed control at the end of the ribbon. It should look like the following.

<Triggers>
 <asp:PostBackTrigger ControlID="WebPartAdder" />
 </Triggers>
 </asp:UpdatePanel>
 </div>
</div>
</SharePoint:SPSecurityTrimmedControl>

3. Add the following outside of the security trimmed control (I put it before, but it doesn’t matter). You’ll notice now the body is set to scroll on overflow, and since it’s on the page it will trump the SharePoint style due to the cascade.

<asp:LoginView id="LoginView" runat="server">
 <AnonymousTemplate>
 <style type="text/css">
 body { overflow-y: scroll !important; overflow-x: hidden; }
 body #s4-workspace { overflow-x: hidden; overflow-y: auto !important; }
 </style>
 <!--[if lte IE 7]>
 <style type="text/css">
 html { overflow: auto !important; overflow-x: hidden; }
 body { overflow: auto !important; }
 </style>
 <![endif]-->
 </AnonymousTemplate>
</asp:LoginView>

Note: This supports IE 6 kind of. It will give a vertical scrollbar, but another one is also added. If I’m forced to find another solution I’ll post it, but I’m sick of IE 6.

This also fixes scrolling on iOS devices as well which don’t take kindly to the way SharePoint 2010 does scrolling by default. Hiding the ribbon alleviates the problem and returns one-finger scrolling.

UPDATE: I realized while implementing this for a client that the permissions level to keep the ribbon from loading was too high. I have since changed the permission level from ManageLists to AddDelPrivateWebParts (a role on the OTB contribute group, because why would you have read only users authenticate?). If you use a custom role be sure to match the lowest authenticated user to a role in this list on MSDN.

SharePoint 2010 Wireframes

Another version of SharePoint is on us, and the need for the vital excercise of wireframes still exists. I created wireframes for MOSS, and now I have added new wireframes for 2010. If you search for SharePoint 2010 wireframes you’ll find a blog post, but those aren’t really true wireframes in the low-fidelity sense (they’re closer to full comps); and he’s not releasing them publicly anyway. I am a fan of very low-fidelity wireframes, and Visio is one of the better tools to do this in.

There are two wireframes: one is for a team site template, and the other is for My Sites. I did not create a publishing site one, because if you’re doing wireframe activities for a publishing site most likely you’re starting over on your interface. You can however use parts from the team site one when building it if you wish. The SharePoint Foundation and Server 2010 team sites are the same so you can use the same wireframe.

They are provided in a Visio format and PDF. I have created them in Visio 2010 and assume they will work in older versions of Visio; please let me know if they do not. I also once again made use of the (updated) GUUUI Visio stencil kit.

UPDATE: A commenter below has linked to some Balsamiq templates if you use that application.

Making DHTML Menus Suck Less

There are designers on both sides of the DHTML menu issue. Some are liberal to use them and have no issue with them, and there are others (including myself) who think it’s not the ideal solution to a navigational structure. Navigation is unquestionably the most important part of any web application, and if it is poorly implemented it makes your application unusable and, more often than not, no one will use it.

I think most DHTML menus are simply a band-aid for poorly conceived information architectures. There also is this idea that has stuck for the last decade that everything should be “within three clicks” as if have four clicks suddenly means the application is less usable. In truth it is a myth: “The reality is that users have no problem with clicking, as long as they are confident they’re heading in the right direction.” Since most of the time designers simply use existing complex information architectures instead of honing and refining them they default to DHTML to expose all of their site structure.

Let’s look at of the reasons that DHTML menus suck, and I will elaborate on several below:

  • As mentioned, often times DHTML menus are used to hide bad information architectures.
  • Many DHTML menus have no visual indication that there is a menu beneath it.
  • Users become frustrated when they have to follow a complex path for a sensitive menu.
  • Navigating by a keyboard loses its luster when using DHTML.
  • DHTML menus are often not built with the ability to designate where the user is at in the site structure.
  • These menus are often inadvertently activated by a browsing user leading to a jarring experience.
  • Even though this is less of a problem then it was even five years ago many DHTML menus use horrendous markup, inline styles, and inline behaviors that fail to degrade gracefully.
  • Some DHTML events, such as onmouseover, are becoming obsolete with the rise of multitouch devices.

DHTML Menus and Information Architecture

Before deciding that a DHTML is the way to go most designers don’t want to work a client through a process of investigating the information architecture to see if the application even needs the DHTML. Do you really need three different levels in your menu? Have you done a proper card sorting exercise to determine the ideal labels and structure for your navigation? Can you implement secondary navigation on pages that will compliment a more global navigational structure instead of having to expose all that content in a single menu? These are some of the questions to consider if your application truly needs the DHTML.

DHTML Menus and Indicators

I am literally amazed at the amount of sites I visit that fail to use any kind of indicator in their DHTML menu to tell the user there is content to be exposed. Most commonly when an indicator is used a down arrow or something close is used to designate that there is content beneath the navigation element. Below are two screenshots of sites that do and don’t use the indicator.

No indicators on Best Buy, Microsoft, and even Portal Solutions.

Sites with indicators include SharePoint 2010, Reuters, and Google.

DHTML Menu Sensitivity

Another issue that frusturates users is how sensitive DHTML menus are. If a mouse cursor accidentally slides off the menu the entire thing collapses and you have to start over. If the DHTML menu has multiple levels this can be even more frustrating! The complexity of so many DHTML menus is often the thing that makes them the least usable.

In addition to the menu accidentally collapsing, DHTML menus also have a tendency to expand even when the user had no intention of opening it by initiating the onmouseover event unknowingly which can be a jarring experience. This is especially bad when it is coupled with no indicators as mentioned in the last point.

Getting Lost in the Navigation Structure

One of the primary purposes of navigation is to inform the user where they are at in the site structure. DHTML menus are notorious for never showing where some is at in the site/navigation structure or where they’ve gone (the latter is less of an issue in my opinion for a navigation structure). A user is often left asking themselves, “Where Am I?” Proper and helpful navigation should at the very least designate where they are in the site as it corresponds to the navigation.

Often this has to be done with a dynamic programming language to allow the menu to show where the user is at in the navigation. An example I can show is how WordPress chooses to implement this functionality.

A Remedy: Superfish

One of the best implementations I’ve seen of DHTML is the jQuery plugin Superfish. It is based on the Suckerfish style of markup which is ideal when putting together navigation on the web. While I don’t gravitate towards DHTML, if you’re forced to use it by a client or some other circumstance then this is the best solution I’ve found.

Suckerfish is an ideal solution, because it deals with many of the issues I’ve mentioned above.

  • There is an option for timed delay on mouseout. This alleviates the issue of someone accidentally mousing out and not having to start the menu traversal all over again. It can be adjusted to the best timeout for your audience.
  • Keyboard navigation is fully supported.
  • It supports the awesome hoverIntent jQuery plugin so it won’t accidentally fire when moused over. It also supports a new variation on the hoverIntent plugin called $.event.special.hover.
  • It can automatically add arrows for you when there are menus beneath, but it also has a specific CSS class attached to those nodes that you can add whatever you’d like to designate content beneath the current menu item.
  • It uses solid markup, and it offers a lot of custom classes added throughout the menu to style various states and elements.
  • There are many examples showing you horizontal, vertical, and other variants on the menus appearance (check out the “nav-bar” example which I like a lot).

Conclusion

While I still firmly believe DHTML menus are not the best solution to the problem, Suckerfish at least provides as usable as an alternative as I’ve seen. DHTML still, I believe, is not necessary when constructing good user interfaces with good information architectures. It is a quickly deteriorating technology due to the use of multitouch devices, but if we’re going to use it we might as well make is as usable as possible.