This is the screencast from the July 2013 FEDSPUG meeting where I presented SharePoint 2010 and Geolocation Data.
Note: This is the second post in this series of SharePoint Developer Tips. SharePoint Developer Tips #1.
Last week while conducting a code review with another Senior SharePoint Developer, the following 3 items caught my eye and I wanted to pass them along. Credit to Jeff Tan for showing the team how these work. Please leave comments with your favorite SharePoint Development Tips.
SPQuery.ViewAttributes = “Scope=\”Recursive\””;
“The ViewAttributes property contains attributes of the View element that is used in Collaborative Application Markup Language. For example, if the Scope attribute is set to Recursive (Scope=”Recursive”), the query displays all the files within a document library, including ones in subfolders. If it is set to anything else, the query displays only files in the top folder.” – MSDN
“Sets the Web page image to the image used by the server to indicate a lengthy operation (typically, an animated image with associated text).” – MSDN
Basically this is a way to create a string made of CAML commands that can be used for a number of useful things including updates to a list. Next time you are looping through a list and making changes consider using SPQuery to get the data you want and this method to make the changes you need.
“A Collaborative Application Markup Language (CAML) that contains the commands, which consists of a Batch element and any number of subordinate Method elements that each specify a SharePoint Foundation remote procedure call (RPC) method.” – MSDN
My favorite SharePoint 2010 trick is how to deal with the out of the box functionality of the global and left navigation links. As many frustrated SharePoint 2010 users have experienced, the functionality shown in the below image is annoying and not easily fixable. The image on the left shows what happens when you right click on the global navigation and the image on the right shows what happens when you right click on the left navigation. Clearly this is not the expected menu which appears.
After much research I have come up with an easy trick to deal with this. I have also discovered the underlying issue and will post the details below in the hopes that a permanent fix can be found. If you take careful note of the position of the (enlarged) cursor, you’ll see that it is positioned to the left of the link I want to open. By clicking slightly to the left (or right) of the link that you want to open, you will get the correct link menu!
So why does this issue happen and why does this solution work? I believe the root of the issue is a design conflict between SharePoint 2010 and Internet Explorer. Utilizing Internet Explorer’s “F12 Developer Tools”, you can see that the text of the link is contained by not one but two span tags. I think it has something to do with this but I am currently unable to confirm. If anyone has any insight into this issue, please let me know!