SPTechWeb Logo
Home About Us  Advertise       
 
 

SharePoint 2010: Mobile Devices and Scrolling




May 10, 2011 —  (Page 2 of 2)
So how do we fix this problem? Turns out there are a few options:

Option 1: Turn off the ribbon for anonymous users
This method uses <Sharepoint:SPSecurityTrimmedControl> and <asp:LoginView> to remove the ribbon control for anonymous users as well as to change some of the CSS that is automatically applied. This is a simple solution, since most anonymous users have no reason to see or use the ribbon. One thing to consider, though, is that the login button will disappear, so you will need to add a login link for yourself, or remember the URL /_layouts/authenticate.aspx.

Option 2:
This is perhaps the simplest solution, as all you are really doing is removing some code and overriding the body CSS to make sure SharePoint turns off the default ribbon positioning behavior. Once the code is in place, devices should be able to scroll fine, but for all users, the ribbon will now scroll away on really long pages. This is very easy, but if you do a lot of long page editing, it can be really frustrating to chase the ribbon up and down the page.

Option 3: Turn off the automatic ribbon positioning and replace it with CSS positioning
This is probably the most complicated solution in the bunch, but it is also the closest to out-of-the-box behavior. In this method, you actually override the default ribbon JavaScript with custom code that uses CSS instead of script to pin the ribbon to the top of the page. This is probably how Microsoft should have done it initially for simplicity (but I’m sure there were technical reasons why JavaScript was a more complete solution for them). Unfortunately, adding it in later involves overriding default behavior, which can be risky, so use this method at your own risk.

So at the end of the day, which solution is best for you? It all depends on how you plan to use the ribbon in your site. If no anonymous or mobile users need the ribbon, option 1 should be fine. If you don’t care if the ribbon scrolls off the page, option 2 will work. And lastly, if you want the closest to the out-of-the-box experience for the ribbon but still have mobile users that need access to it, option 3 is probably the most complete.

For Todd’s solution, option 1 was the simplest and best solution... and for the record, I made him make the changes himself (I like him, but not that much).

Randy Drisgill is a consultant at SharePoint911 and a Microsoft MVP in the technology.


Pages 1 2 


Share this link: https://sptechweb.com/link/35515

Add comment


Name*
Email*  
Country     






 
 
This site's content Copyright © 1999 - 2012 by BZ Media LLC, All rights reserved.
Legal and Privacy
• E-mail: