Recently a developer friend was wondering why all the built-in App Icons changed colors on his SharePoint 2013 site when he applied a different color scheme using the “Composed Looks” functionality,but Icons for custom apps he had deployed remained their original color. The screenshot below shows the Site Contents page both before (Left Side) and after a Theme has been applied using a Composed Look (Right Side). You can see that all the Icons on the page changed except the last one on the right. This is the App that I installed using the Visual Studio 2012 SharePoint Hosted App project. So the question is Why do all the other Icons change?
The first theory was that the App Icons were being recolored using the Theme CSS support that has been available since SharePoint 2010. But the ability to recolor an image using CSS has always been limited to background images loaded through CSS. These Icons are loaded using an <IMG> element so there is no way to specify the image in CSS and no way to recolor it.
After using IE’s Developer toolbar to examine the HTML and CSS on the pages above I found that the image itself doesn’t get recolored. But the <a> (anchor tag) that surrounds the Icon is a square rectangle occupying the space behind each image that has its background set to one of the theme colors. You can see in the screenshot below that the <a> tag has its background set to a class of “ms-storefront-appiconspan’ which is set to an rgb color from a themable css file. But why does changing the background behind the Icon change the color of the Icon?
The trick is that the Icon file itself is a transparent PNG that is the same size, 90 X 90 pixels, as the anchor tag with the background color behind it. That way the background color shows through the Icon and appears to recolor the icon itself. So let’s see what happens to my Visual Studio project if I replace the blue in my App Icon with a Transparent background. the image below shows the original Icon on the left and the new transparent Icon on the right after I cut the background out using Paint.Net.
After uploading the new Icon image into my visual Studio project and redeploying the custom app you can see that the custom app Icon changes colors along with the Theme in the screenshot below. If you restrict your Icon to white images and text on a transparent background then your Icon should look like it fits no matter what Composed Look is applied to your site.
Last week I presented a talk to the Cleveland SharePoint User’s Group on the new SharePoint 2013 “Apps” model. At the end of the talk I promised to post my slides.
You can download a PDF of the slides from the talk using the link below:
An Introduction to SharePoint 2013 Apps
If you who have been learning to develop the new SharePoint 2013 Apps then you know that the toolset for doing that in Visual Studio 2012 didn’t ship a finished RTM version when SharePoint 2013 shipped its RTM version in November. Instead we’ve all still been working on a Preview 2 version. Well no longer! The final version of Office Developer Tools for Visual Studio shipped today. You can read more about the announcement here:
And more importantly you can download the new tools via web platform Installer from the following URL:
Next week I’ll be headed for Denver to speak at the Denver SharePoint Saturday event. I will be presenting two sessions. One will be an overview for users, admins, and developers who are just getting started on SharePoint online in Office 365. The other is a more in depth talk for developers and admins on managing the various places that SharePoint stores user information. I’ve reprinted the abstracts for my talks below:
Intro to Developing for SharePoint Online: What Tools Can I Use? – The introduction of Office 365 drastically changed the SharePoint development landscape. As a managed online service the rules for developing customizations for SharePoint Office 365 are radically different from the ones for an “on-premise” installation. They are also slightly different than developing sandbox solutions. In addition many companies who currently use dedicated SharePoint installations are beginning to consider eventual migration to the Office 365 cloud environment. That means even current “on-premise” development is often constrained in new ways. No matter what kind of development you currently do you need to know how to develop for Office 365. In this workshop/session we’ll cover the following topics:
- Setting up an Office 365 development environment
- Developing sandbox solutions for SharePoint Online
- Building reusable workflows in SharePoint Designer 2010
- Why the Client Object Model is even more important in Office 365
Users, Profiles, and MySites: Managing a Changing SharePoint User population – Every company has some level of employee change and turnover. The question is how do you manage the graceful removal or modification of user information from SharePoint? If everything is perfectly aligned SharePoint will automatically process and delete the user account, permissions, profile, and MySite for users that are deleted from Active Directory. Updates to user information are also automatic in many cases. But most SharePoint installations don’t have all the necessary components aligned for automated removal of old users and some profile properties refuse to update. In this session we will examine the underlying processes controlling user accounts, permissions, profiles and MySites and how they interact. We’ll look at what works, what doesn’t work, and how to work around it. Along the way we’ll recommend Best Practices for managing users, their profiles, and MySites in a SharePoint environment.
I’ve done programming in a variety of environments over the years. Case sensitivity was one of the things that was the most difficult for me to get used to when I moved from VB to C# a number of years ago. In fact if it weren’t for Intellisense I would probably still be swearing at C# on a regular basis. I’ve learned to live with, and even make use of, case sensitivity in my C# programs over the years. But it doesn’t come naturally. I still tend to think in a case insensitive fashion.
As a result I was somewhat surprised to run into someone having an issue recently when trying to add SharePoint Managed Metadata terms to a user profile programmatically. They reported that SharePoint wasn’t consistent when adding terms to the Ask me About profile field programmatically. It turns out that the real problem was that they had duplicate fields where the only difference was the case of the first character of the abbreviation. After some investigation here’s what I discovered.
- SharePoint won’t let you add two metadata terms under the same parent if the only thing that differs is the case sensitivity of the term. The image below shows what happens if you try to add “ABC” as a term when “Abc” already exists under the same parent term.
- You can add (but probably shouldn’t) a term that differs only based on case sensitivity if you also change the hierarchy that the term inherits from. The image below shows the same “ABC” term added to a different parent. This time the addition is successful.
- When you try to add any combination that starts with abc to a managed metadata column you get both terms. You can of course choose the one you actually want, but that’s based on the hierarchy of the term, not its case sensitivity.
The lesson here is that unlike some things like C#, the Managed Metadata service is NOT case sensitive. You should try to avoid adding terms to the service that differ only based on case sensitivity. This is particularly true if you intend to add managed metadata to fields programmatically.