Category Archives: Design

Hide ‘My Site’ Link from Welcome User Dropdown Control

Posted by on May 11, 2012 at 4:32 pm.

SharePoint 2010 adds lots of new, great social functionality. Right? True! However, it’s confusing and the end user wasn’t consulted. That’s ok, we can fix a lot of things using custom branding.

If you haven’t already noticed by my blog, branding in SP is one of my favorite things to do. I n another blog post coming soon I’ll post my session notes and materials from SharePoint Saturday Baltimore with source code you can check out.

So – one of the more confusing elements in SP2010 is the new My Site concept. Yes, it was around a bit in 2007 but they’ve changed the architecture in 2010. Don’t let the phrase “My Site” fool you, it actually refers to 3 things – when Microsoft says My Sites, they really mean:

  • User Profiles
  • User Personal Content Sites (your own site collection under the My Site host)
  • Your personalized homepage at the root of the My Site host

That last one is the more confusing of the 3. It’s not very obvious how you can customize the My Site homepage layout. Why? Well, that’s a whole other conversation all together. In short a user can customize the My Site homepage and make it their “launch pad” for the application:

customizemysite

Super not obvious, right? In fact this causes so much confusion for most of my enterprise level clients that we usually hide it all together! To do this, you can use an awesome CSS trick I learned from Anatoly Mironov:

Hide My Site link from user welcome menu

.ms-MenuUIUL li { display: none;}

Hide My Profile link from user welcome menu

.ms-MenuUIUL li { display: none;}

Of course you could also just disable this functionality from the User Profile Service Application permissions in Central Admin, but then you couldn’t use them at all. Sometimes you want these functions, just want to present them differently to the user.

Sometimes I even go another step further and add in a customized welcome.ascx to the page, start by copying the out of the box, create CustomWelcome.ascx and change the reference in your master page. Then you can add in your own links – like a custom ‘My Site’ link that actually takes you directly to your personal content site!

customwelcomecontrol

This is what most folks actually want… just link to /_layouts/MySite.aspx and you’ll go to your personal content site, or create one if you don’t already have one. You can also use /_layouts/UserDisp.aspx to go to the user’s User Profile.

Hide Page Elements from Print View

Posted by on May 2, 2012 at 10:12 am.

On occasion I’ll have a client who needs to have printing functionality in their SharePoint portal. It’s fairly uncommon now – the whole point is to go digital, right? But it does happen. Most recently with a client in the bio-technology world, they were used to printing everything and just storing it in SP.

Calling the browser’s print function is the easy part:

Link to print current page:

<A HREF=”javascript:window.print()”>Click to Print This Page</A>

Display a button to print (which you can style of course:

<SCRIPT LANGUAGE=”JavaScript”> if (window.print) { document.write(‘<form><input type=button name=print value=”Print” onClick=”window.print()”></form>’); } </script>

That’s the easy part. Now you’ll notice when you do this, there’s going to probably be a lot of things you see in your print out you don’t want to see. You have options! Simply call a neat CSS trick, the import function. This allows you to inject CSS based on your media type – print, mobile, web – so certain CSS styles only show in print view. This way you can do a nice {display:none;} on the elements you want to hide. For example, if I want to hide the title from print view, I would…

@media print
{

#s4-titlerow, #s4-statusbarcontainer, #s4-topheader2 { display:none; visibility: hidden; }

}

Neat trick, huh?

Activate Feature for All Sites in a Web Application

Posted by on February 21, 2012 at 10:32 am.

Recently I deployed a custom branding feature stapler for one of my customers migrating from 2007 to 2010. As part of the branding feature we had custom layouts and design on the My Site host and user personal sites. New personal content sites created automatically had some custom branding applied by swapping out master pages and adding some linked CSS style sheets to the Style Library.

The solution works great for new personal sites on creation, but migrated sites still had the old look and feel. I wrote the branding feature in a way that it is visible to users and can be activated on a site (sp-web). Since I’m not about to go activate the feature manually on litterally thousands of sites, I got a handy script to do it for me! Big thanks to my college Donal Conlon on this one, Principle Consultant and all around rock star at my company Jornata.

You first need to generate an xml file containing all the sites you want to work with. I’m sure there’s some PowerShell that would do the same thing but I already know this stsadm command will work.

stsadm -o enumsites -url http://mysitehosturl > mysites.xml

Once you have this XML file, feed it into this PowerShell scripts to activate your site feature. Note you’ll need to know the feature’s GUID in order to make it work.


## Enable feature on all sites in site collection
## This script takes the output from the stsadm -o enumsites command (xml)
## Run 'stsadm -o enumsites' first to generate the xml which lists all the site collections for the database

function ActivateFeature([string]$url){
 $featId = "7a8597ff-67a7-473e-b2f5-46d5b504643b"
 $feat = "BrandingTheme_MasterPageDeploymentFeature"

 $site = Get-SPSite $url
 $site | Get-SPWeb -limit all | ForEach-Object {
 if (!$_.Features[$feat]) {
 #Get-SPFeature -Identity $feat | Write-Host $_.Enabled
 try{
 Enable-SPFeature -Identity $feat -Url $_.Url
 }
 catch{
 Write-Host "Feature may already enabled"
 }
 }
 }
}

Write-Host "Getting sites xml file..."
$config = Get-Content $args[0]
if($config -eq $null -or $err)
 {throw "unable to read xml file. Use stsadm.exe -o enumsites to generate xml"}

Write-Host "Number of site collections: " $config.Sites.Count
[System.Xml.XmlNodeList] $navElements = $config.SelectNodes("/Sites/Site")

foreach ($navElement in $navElements)
{
 $url = $navElement.GetAttribute("Url")
 Write-Host "Appling branding to $url"
 ActivateFeature $url
}

Download the PowerShell script in a .zip file here.

Alternatively you could use SharePoint Manager 2010 to activate the feature without needing to browse to the site. This is still a very manual process but a great tool as you can see hidden features as well which you can’t view in the UI.

SharePoint 2010 Balsamiq Mockup Wireframe Template

Posted by on November 15, 2011 at 12:31 pm.

One of my favorite things to do when designing a new SharePoint 2010 branding feature is the planning phase. I know what you’re thinking, “you actually enjoy going back and forth, spinning your wheels with customer design teams who take weeks to make decisions?” Yes, I do.

Before doing any actual design work, I love to use a tool called Balsamiq Mockups (really great, friendly team over there by the way). Using this tool you can quickly and easily make wire frame mockups and review them with decision makers to get your layouts right. I’ve made a template for SharePoint 2010 – screenshot below – you can download free here .

Although it can be tedious and sometimes annoying, it really helps flush out all the bad design thoughts many people have. Believe it or not everyone is an “expert” when it comes to design and the look and feel of their corporate image. I’ve run into a few really good designers or folks with good constructive minds, but more often than not people just want to be a part of it more than actually focusing on the best option.

Anyways… to aid in the process I always recommend going through the same steps to successful design:

  1. LISTEN: Understand the customer’s needs and really understand their end goal. Remember, budget and timeline often must take priority over extra features, as much as you might want to go above and beyond.
  2. VALIDATE: Make sure the right key business decision makers have not only reviewed, but also signed off on what you’re thinking. This needs to be done every step of the way really, not just in the beginning.
  3. INITIATE: Start making layouts! Using tools like Balsamiq Mockups is really helpful here, making simple and quick wire frame designs. Balsamiq is great because it doesn’t focus on style – ignore colors, fonts, images, etc at this point – really focus on the structure. You need the foundation before you build a skyscraper, designing an application is no different.
  4. STYLE: My favorite part by far, here’s where you actually spend the time to make it look cool. Again, it’s important to validate, validate, validate every step of the way.
  5. APPROVAL: Of course you’ll need that final approval and sign off from not just the core team, but the business as well. If your main sponsor/contact hasn’t scheduled this make sure you do!
  6. PUBLISH: You’re live! Consider it closed? Nope, not yet… always remember the post-launch support and tweaks that will follow.

Behind the SharePoint Person Placeholder Image

Posted by on October 19, 2011 at 2:10 pm.

I had heard a rumor a while ago the default user placeholder image was actually a silhouette of Bill Gates. Specifically I had heard it was originally a college or high school yearbook photo from way back when. However, it looks like it’s actually from his mug shot after being arrested for speeding!

silhoutte1     bill-gates-mug-shot

Hilarious! Who would have know? Confirmed by Ars Technica, Wikipedia, and a few other blogs with comparison photos. You can see the outline image in the Outlook Social Connector as well.