LifeInSharePoint – Metro Weather Updated to new API

Overview

This is just a quick note that the Metro Weather WebPart has been updated to take into consideration the latest API as the old one was now out of date.  Can you also please check your API keys as many may expire on the 31st August.

Download the new WSP here.

https://lifeinsharepoint.codeplex.com/releases/view/101035

Thanks and sorry for the delay.

Why I have been so quiet, and what I am going to do about it.

Summary

As many of my readers may have noticed, I have not posted for a couple of months and this is something that I would really like to change soon.  The reason for my lack of posts is due to working on my first Responsive SharePoint 2013 public facing website which I have been working on furiously for the last two months with a team of developers at my job at ICS Solutions Ltd.  The project was for Northampton University and they wanted to migrate their website from their current CMS system called Jadu and instead host their website on SharePoint 2013.  What made this website even more interesting was that the website was hosted in Microsoft Azure’s IAAS which not only enabled awesome scalability but a much easier and faster infrastructure build.

The SharePoint project took advantage of so many fantastic features that comes as part of SharePoint 2013 such as Managed Metadata Navigation (Friendly Urls), Content by Search WebPart (CSWP), SharePoint Catalogs, and the much improved search service in SharePoint 2013.  It is my plan to give an outline as to how the project was designed, how the project was developed and as many of the “gotchas” that I suffered along the way so that hopefully you do not stumble upon the same issues that we faced.  Before this happens however I am taking a much needed holiday to de-stress but keep your eyes pealed for a “How we did it” series soon.

For those interested in the website please visit http://www.northampton.ac.uk and provide some feedback in the comments below.

See you all soon.

Quick Tip – SharePoint 2013: Get Managed Navigation Term for Current Page in Code

quicktips

I have recently been building alot of new functionality in SharePoint 2013 and wanted to extend my Promoted Links WebPart to enable me to place the WebPart on a publishing website page layout and then have each page display a different set of links depending on which links in the list were tagged.  I was able to easily add a new managed metadata column which used the Managed Navigation Term set for the current site collection as its source so that I was able to select which page to display however I was unable how to change my WebPart to understand what the current pages term was.  Having used the Content by Search WebPart I was aware that this has the functionality built so obviously it should be a fairly simple process.

I also know there is an OOTB WebPart called the Term Property WebPart which enables you to display properties based on a specific term or properties based upon the current context.  Using this WebPart however would not be an option as there is no connection properties on this WebPart.

To find the solution I dug around the MSDN technical documentation for 2013 and came across the TaxonomyNavigationContext class (http://msdn.microsoft.com/en-gb/library/microsoft.sharepoint.publishing.navigation.taxonomynavigationcontext.aspx)  This class was the answer to my problem, and by passing your current context you can easily get the information you need. e.g.

TaxonomyNavigationContext tnx = TaxonomyNavigationContext.Current;
                if (tnx.HasFriendlyUrl)
                {
                    TermTitle = tnx.FriendlyUrlTerm.Title.ToString();
                }

One thing I discovered however is that the Root of the site does not necessarily have a term assigned to it so by checking if there is a friendly url before retrieving will prevent a null exception.

 

SharePoint 2013 Developer Tips Series – Episode #1 Where is my /_layouts/?

SharePoint2013DeveloperTips#1

The Problem

One of the biggest issues I faced when migrating code from my SharePoint 2010 solutions to SharePoint 2013 was the references that were made to images, css etc stored in the /_layouts/ directory.  In SharePoint 2010 when you added an item into this via visual studio (or even manually) the url for this would be for example: http://servername/_layouts/customfolder/images/myimage.png.

It would stand to reason that doing the exact same process for a SharePoint solution created in Visual Studio 2012 for SharePoint 2013 would be exactly the same right?  Sadly when migrating code to 2013, compiling and deploying all my layouts references appeared to be ok but for some reason would never work and would suffer from missing images, missing css styles etc.

The Solution

When I discovered the cause and the reason for the change things began to make complete sense.  SharePoint 2013 has a great new upgrade mechanism which enables customers to install SharePoint 2013, and then mount the content database from their SharePoint 2010 environment and run it as it always did in SharePoint 2013 without making the actual upgrade to 2013 until they are ready to.  Because of this ability to run both SharePoint 2010 and SharePoint 2013 natively on the same server hardware they had to ensure that it was backwards compatible.

So, how does this effect my /_layouts/ issue?  Any SharePoint solution compiled in a SharePoint 2010 solution which places assets into the /_layouts/ directory will be referenced as they always have been.  SharePoint 2013 solutions however although referenced in Visual Studio in exactly the same way, will now require references to be made as follows: http://servername/_layouts/15/customfolder/images/myimage.png.

The addition of the /15/ after the /_layouts/ is all that was required.  This caused my many headaches but thankfully once you know why, making the reference changes is easy.

 

SharePoint 2013 Developer Tips Series – Overview

SharePoint2013DeveloperTipsOverview

Overview

It has been a couple of months now using SharePoint 2013 with serious commitment, and during this time I have come across many gotchas, quirks, issues, and new ways of doing things from a developer experience compared to previous versions.  It is my intention of this series to give you information around what experiences I (and the development team I work with) as well as share information from across the SharePoint social scene.  It is my hope that this will be a useful resource for developers, as well as a place for you to also share your tips you may have found yourself to make this a useful “go-to” resource.

Episodes

The tips are going to be categorised into their own seperate “episodes” with a list of all existing and coming soon episodes listed below.