When software attacks!

Thoughts and musings on anything that comes to mind

16. January 2012 20:07
by Rik Hepworth
0 Comments

Living with the Nokia Lumia 800

16. January 2012 20:07 by Rik Hepworth | 0 Comments

If you call in at Black Marble you’ll see Nokia’s everywhere. They’re talking over the place. It takes me back… I remember when almost everybody I knew had some kind of Nokia or another. I started with the 5.1 on Orange, followed by a sequence of progressively smaller phones. Then came Series 60 and I walked away – I never liked the interface. I swapped to Sony Ericsson and the P800, P900 and P910. I moved to Windows Mobile for time, until I could stand it no more and swapped to an iPhone (much to the grumbling of folk round here!).

I liked my iPhone – it was reliable, flexible and did what I wanted, when I wanted it to (until the last IOS revision, sadly). Windows Phone was tempting – the interface looked great and felt great, but the handsets just weren't there. I tried an LG and hated it, and the HTCs are just too darned big.

When the Lumia was announced I signed up on the Orange site well before release and I picked mine up on day 1. Now the iPhone is gathering dust (I thought I’d still use it for TomTom but even that has been usurped) and I can’t say I miss it.

Overall I can heartily recommend the Lumia. There’s lots to like. There are some niggles but none that drive me crazy. Over the past two months it’s been reliable, usable and flexible – just like my iPhone was.

The Good

  • Size. Just right, actually. Marginally smaller than my iPhone 3GS, although perhaps a little fatter. Nicely contoured and fits well in the hand.
  • Screen. Great. The AMOLED display is really crisp and clear. Sure, the iPhone 4 has a higher resolution but the standard 800x480 Windows Phone resolution is just fine thanks.
  • Construction. The polycarbonate body feels nice in the hand. The phone is well put together – nothing rattles or wiggles where it shouldn’t and the curved gorilla glass front looks and feels the business.
  • Camera. The Lumia takes better pics than my 3GS did. The LED flash is staggeringly bright when it goes off. I like the various modes that are available, such as night and sunset, and they have been useful more than once. I’d like to be able to use the camera app directly to take Hipstamatic-type pics without needing to post process in an app, though.
  • Speed. It’s a pokey little thing. Apps run smoothly and quickly.

The Bad

  • Charging. Battery life is on a par with the iPhone, so no complaints there, but if the battery runs completely flat I can only use the Nokia charger to revive it, and even then once or twice I’ve had to use the 10-second power button press reset to force the thing to charge. No issue with battery life though – the much discussed problem has never materialised for me.
  • Touch. For the most part it’s great, but every now and then the touch screen can be a little over sensitive, or not sensitive enough – take your pick. This could be a calibration issue or something to do with the gorilla glass thickness, I don’t know. It doesn’t stop me using the phone but occasionally it niggles me when in a game.
  • USB Port Cover. This is another one that’s been debated elsewhere. I like the overall design and that the port is protected, but frankly, it makes plugging the thing in a fiddly process. For somebody that has grown used to simply plonking his iPhone onto the dock connector of a raft of household electrical appliances it’s a bit irritating.

The Apps

  • Nokia Drive. I like this, although in it’s current incarnation it’s no TomTom. I miss the lane guidance and I particularly miss the traffic updates. Supposedly the latter will arrive in an update, and it’s hard to complain when it’s free. Overall it works well and gets me where I need to go.
  • XBOX Live. This is becoming a bit addictive. I have an XBOX (two, thanks to Orange and the Lumia offer) but I never used to pay so much attention to Achievements as I do now. XBOX Companion is funky; Halo Reach is handy and being able to see my gamer friends is great. There are some really good games available, and many of the most addictive I’ve found are free! I didn’t use the iPhone for gaming half as much as I do on the Nokia.
  • Bing Get Me There. I had a number of London Underground and similar apps on the iPhone but they pale in comparison to Bing Get Me There. It’s fabulous, fully featured and free! I go to London regularly, but not regularly enough to be an old lag when it comes to navigating the tube. This is a great app!
  • Missing in action… I had a raft of apps on the iPhone that I used regularly. Some have an equivalent on Windows Phone, but not all. I really miss Hipstamatic, and there are no apps that are its equal for Windows Phone. Others have third party apps but not first party, such as TripIt, which I find really helpful (Trip Hub steps up there). It’s getting better all the time, but it’s not yet at a point where I can match the variety of small but useful apps that I had on the iPhone.

14. December 2011 09:54
by Rik Hepworth
0 Comments

Fujitsu Stylistic Q550: A Tablet for the Enterprise

14. December 2011 09:54 by Rik Hepworth | 0 Comments

Every now and again, whilst I’m away from the office, the gadget pixies visit my desk and leave something interesting for me to play with. It’s a bit like Bagpuss, except stuff works when it arrives and I can never get the guys to wake up when I need them too.

The last time this happened there was a tablet sitting on my desk. I like it enough to write about it.

The Stylistic is never going to win a beauty pageant. Which is a shame, because it has all the features that I usually bemoan the lack of in Windows Tablets. Most of them are designed for the consumer. That’s great, but I get involved in lots of projects these days where the end user wants the convenience of a tablet device but the demands of their IT department make them unusable.

For example, I once visited a site where the IT department had imaged the tablet we were to use and applied their standard group policies. They required a smart card for authentication and forced CTRL-ALT-DEL to logon. You can probably see the problem with that.

It wouldn’t phase the Stylistic.

WP_000043

Stuff I like about it

  • Removable battery. I’ve played with this for a while now, and I can report that battery life is on a par with the other tablets I’ve played with – four to five hours. That’s good, but not a working day. Being able to carry a spare battery if I need it means that I can be away from a power outlet all day and not worry.
  • Smart card reader. Two factor authentication on a tablet – fantastic! It’s just what enterprises need in order to support these kind of devices. As an IT manager I want to be able to apply group policies to these devices. They are extremely portable so I have to be sure that the data on them is secure.
  • TPM Chip. I can bitlocker the drive on this thing properly. Shame the one I have to play with came with Windows 7 Professional on it. Be careful with this, though: I checked the product information and the TPM chip is an option on the device. I think that’s a mistake on Fujitsu’s part – most organisations won’t check and will probably order the wrong variant.
  • Fingerprint Reader. Personally, I don’t like or trust fingerprint readers for authentication, but I like that I have the option.
  • Matte screen. This is great! Virtually every windows tablet I have seen has a glossy screen. That’s great in the shop window and a real pain in the real world as I can’t see the screen for the reflections. The Stylistic has a matte screen and it’s incredibly easy to read and use.
  • Stylus. It’s much easier to write notes using OneNote than type on a software keyboard. The digitiser on the Stylistic is a dual mode one that works with fingers and a stylus and I like it.
  • Multi-touch. The touch digitiser on the Stylistic can handle four points. It may be able to handle more but I haven’t found any detailed information. Four is better than most windows tablets, however, which tend to deal with only two touch points.

WP_000044

Stuff I don’t like about it

  • Stylus. Don’t get me wrong – the stylus is great. The fact that there is nowhere to put is is very annoying. It’s a nice stylus, but there’s no clip on it so I can’t treat it like a pen and keep it in my pocket, and there’s nowhere on the tablet to stow it away.
  • Styling. From the front the Stylistic doesn’t look too bad. However, flip it over and it’s been hit with the ugly stick. I realise that Enterprise purchasing teams don’t care about looks but users do. Why can’t it be sleeker. Heck, I’d settle for it simply being all one colour!
  • Fiddly buttons. There are lots of buttons down the side of the Stylistic. One brings up a software keyboard, but it’s not the standard Windows 7 one – it’s a nasty one from N-Trig that crashes a lot. One makes the screen rotate which I view as a bit surplus to requirements – why can’t I simply have a lock rotation button like every other tablet. With the stylistic I must fiddle with a tray app to turn auto-rotate on and off, then poke at the little button to rotate the screen if I have disabled the auto-rotate in an outstanding failure of ergonomic design. There’s also an ‘Alt’ button that I admit to not having figured out.
  • Crazy Gestures. Why do all these tablet manufacturers insist on ‘improving’ Windows 7 with complex multi-touch gestures that nobody can remember and really aren’t useful. I don’t want crazy three- and four-finger gestures. Fortunately this is all software and I can turn it off.
  • 32-bit Only. Why would you release a piece of kit these days that isn’t 64-bit capable? I appreciate that the tablet only has 2Gb of memory (which is enough for most people’s needs) but operating systems are moving steadily to 64-bit and I’d rather not be left behind.

Overall: A Win

Most of the things I find annoying are implemented by software and I can turn them off. The fact that it’s a sexy as a house brick is of little importance to the enterprise market at which it is aimed. Overall the Stylistic has a raft of features that enterprise IT demands but doesn’t sacrifice the key elements of tablet design to deliver them. The Stylistic is not too heavy to hold, is a nice size and has good battery life for a Windows machine. As an enterprise tablet I think it’s a solid choice that supports all the security functionality I would want to enable for such a mobile device.

9. December 2011 20:16
by Rik Hepworth
0 Comments

Streaming video to XBOX 360 from Windows Home Server 2011

9. December 2011 20:16 by Rik Hepworth | 0 Comments

This one threw me for a while and I could find nothing specific on the web. I wanted to use my Xbox 360 to watch video streamed from my Windows Home Server. Streaming is switched on by default, I hear you say. Why, yes it is, but each time I tried to connect the Xbox I received an error.

The solution? Enable the Guest account on the server. Do this with care – revoke it’s access to everything except the folders you want to stream unless you want to allow read access to everything on the server.

Once Guest was enabled and the access rights were applied the whole thing worked like a charm.

7. December 2011 16:03
by Rik Hepworth
0 Comments

Fundaments of planning your beautiful SharePoint web site

7. December 2011 16:03 by Rik Hepworth | 0 Comments

This article is all about preparation. It’s about the thinking and planning you need to do if you’re going to successfully build your wonderful, unique and striking website on the SharePoint platform.

I’ve been helping customers implement SharePoint solutions for quite a while. Life gets interesting when those customers want to use SharePoint to host their public website or an intranet of published content. SharePoint is a great platform with a host of powerful features that make it a solid choice for large or complex websites, sites that have to deal with large volumes of traffic or simply sites that need real business processes wrapped around the publishing model. Much of my time in these scenarios is spent helping the customer prepare and plan, and I’d like to share some of my experience.

We’ve planned the site…

site plan

How many times do you visit the customer and they greet you with an enthusiastic ‘We’ve planned the site and documented it for you’? I get twitchy when I hear that, because it usually involves me being handed a piece of paper that looks like the picture above. That would be great if it was a starting point, but many times the customer genuinely believes that’s all they need to tell me and the creative agency, and from that tiny post-it note our creative minds will issue forth the next great site on the web.

SharePoint rewards attention to detail

You can’t treat SharePoint like an old web server and expect to get away with it. Treat a web site as a vague collection of folders with pages in that present content of some kind to the reader and you will quickly find yourself in a pit of despair. There are four areas that demand your attention – attend to these with diligence and the technical solutions will be much easier to determine.

Before you start, read Don’t make me think by Steve Krug and The Elements of Content Strategy by Erin Kissane. Both are quick reads that will help you immeasurably.

Content Strategy

Content Strategy is all about identifying what content you have, describing it, identifying who owns it and what its lifecycle is. It’s about discerning the difference between a product datasheet, press release, case study and staff biography. In SharePoint terms, it’s all about content types. What information do we store and how? What columns constitute a press release, and is it based on an article page or an item?

I find that full-service creative agencies that are used to writing copy, be it for print or the web will understand this already. Creative agencies that are more focused on visual design, be it for the web or otherwise tend to struggle with the concepts of content strategy. Once you’ve got them on board, however, their lives are much easier as well: Now we know that we have those four kinds of content then the creative agency can choose to design unique ways to display them.

Design

Knowing what the different kinds of content are will invariably help the creative guys. Now they know that they have to design ways to present each of the different kinds of content – a product page will look very different from the Chief Exec’s Blog. This will help you to answer SharePoint questions like how many masterpages and page layouts and will start to guide your thinking in terms of site structure.

User Experience

Not only do we want to know what the site looks like, we need to think about how users will interact with it. Do we want to use clever icons for navigation? Do we need to present content based on what we know about the user – age, gender, role, etc? We will almost certainly need to build something bespoke to deliver the user experience which means we need requirements so put plenty of detail into describing how things will be expected to work.

Information Architecture

There are some great books on IA out there. SharePoint places additional constraints on projects though: Perhaps our security needs mean that we must create separate site collections for content. Maybe we want radically different design for certain content which means different masterpages and separate sites. Certainly we should avoid simply pouring all our content into one large pot, but if we need to aggregate items on our homepage what implications does that have on our structure?

Measure twice, cut once

If all the steps above sound like a lot of planning then you’d be correct. However, convincing the customer to pay for a planning phase up front will save everyone time and money later. It’s important to make sure that the creative agency understands that the planning phase is critical to them as well – why rush off and design something beautiful when any of those four elements above may throw the whole design into disarray?

The SharePoint Solution

Each of the four areas influences one another and each in turn influences your SharePoint solution design. Technical and budgetary constraints in this area will undoubtedly cause you to revise your plans, but without the information gathered in those four areas of planning you won’t have enough detail to accurately specify and estimate the project, let alone deliver it successfully. In order to deliver, we as practitioners need to understand those four key areas, especially if our customers don’t.

Useful Reading

Books you may find useful when tackling those four planning areas:

7. December 2011 12:51
by Rik Hepworth
0 Comments

Displaying a SharePoint 2010 library on a page in a different site within the same site collection

7. December 2011 12:51 by Rik Hepworth | 0 Comments

One of our customers contacted us the other day with a problem. They wanted to put a view of a document library that was located in the top level site of a site collection onto the landing pages of all the second level sites in that collection. The customer had consulted the internet hive mind and found a blog post with instructions which had been diligently followed and yet whenever a user clicked ‘New’ on the ribbon bar an error occurred.

After a bit of poking and prodding on my local test system I not only replicated the fault but also found the cure. Since none of the other sites on the internet that I found mentioned this, I thought I’d better write it up for the world.

 

The screenshot below shows you our goal. The ‘Main Site Shared Documents’ web part actually points to a document library that is in the site above the one we are in.

Group Site with external document library web part

Step 1: Export the original list web part with SharePoint Designer 2010

In order to place the view we need on our page we need a web part. To get that we have to edit the page of the view of our document library in SharePoint designer.

Navigate to the view of your document library and in the ribbon part choose ‘Modify In SharePoint Designer (Advanced) from the drop down ‘Modify View’ menu.

modify view in designer

 

Once you have the page open in SharePoint Designer, you need to select the XsltListViewWebPart that is showing the contents of the library.

xsltlistviewwebpart

With the web part selected you will be able to switch Designer’s ribbon to the Web Part tab and choose ‘To File’ from the Save Web Part panel. Saving to the Site Gallery won’t work – I tried and SharePoint complained every time I added the web part to a page.

When you save the web part SharePoint Designer will throw up a dialog box:

export web part question

You need to answer ‘Yes’ to this question because we want the web part to always point at our target document library, no matter where we use it.

save web part to file

Step 2: Add the web part to your page

Edit your target page and add a web part to your intended zone. When the web part panel comes up, you will see ‘Upload a Web Part’ in small text beneath the Categories panel and clicking that will expand the control to give you a file browser.

Browse to the web part you saved from SharePoint Designer and then Upload the file. The web part picker will close at this point. Don’t panic!

upload a web part

Go through the steps to add a web part again and this time in the Categories panel you will have a new item at the top called Imported Web Parts. Select that and your web part will appear in the list so you can add it to the page.

add an imported web part

Step 3: Change the toolbar setting on the web part

This is the important bit! When you add the new web part to your page everything appears to work fine. Documents from the document library open fine and clicking the ‘Add a new document’ link will open the upload dialog as they should. However, if you use the ribbon bar then you will notice very quickly that it is not the correct ribbon bar for the library – the items on the New menu will be wrong (if you have custom content types that’s easier to spot!) and trying to use the buttons will cause errors.

The solution to this conundrum turned out to be straightforward – simply change the toolbar setting of the web part. If you choose ‘Full Toolbar’ or ‘Show Toolbar’ you will see the erroneous behaviour; choose ‘Summary Toolbar’ or ‘No Toolbar’ and all will work fine.

broken menu with web part settings

The setting shown above on the web part will give you a broken menu (the other web part on the page is a calendar, so I get appointments!)

working menu with web part settings

The setting shown above works just fine.

12. May 2011 18:05
by Rik Hepworth
1 Comments

Making SharePoint 2010 search pages work with a proper master page

12. May 2011 18:05 by Rik Hepworth | 1 Comments

If you talk to those who know me about my pet hates in SharePoint, the search pages will come up every time. It’s not that I hate search itself – that’s great, but the minimal.master is just plain annoying. It makes the search centre a black hole into which you can fall but not navigate out of – there’s no navigation and the portal site connection doesn’t work.

I’ve been meaning to get search working with a real master page (step forwards, v4.master) for a while and never got around to it. However, I needed to fix it for a demo and having done so I thought I’d document the steps involved for the world.

To set the scene, here are some screenshots of the default Enterprise Search Centre pages:

default searchcentredefault searchresultsdefault peopleresults

If you climb into site settings and change the Site Master Page to v4.master, this is what you get:

v4 master search page

That’s not very usable, is it. Moreover, if you click the breadcrumbs/portal site connection icon in the top bar you see the following:

v4 master search page with search box

That’s just barking mad, frankly. However, it does give us a solid clue as to how we go about fixing the page.

Step 1: Fix the layout pages

I had a rummage around the search centre’s masterpage folder and found the cause of our problems. Some bright spark decided to use the PlaceHolderTitleBreadcrumb as the content area to put the search box in. That speaks more about the structure of the minimal.master page than the search layout pages, to be fair. It is most definitely not where it should be, however.

Using SharePoint Designer, open your Search Centre SharePoint site and look in the _catalogs\masterpage folder. In there you will see three page layouts: SearchMain.aspx, SearchResults.aspx and ReopleSearchResults.aspx.

sharepoint designer masterpages highlighted

Let’s do SearchMain first – the site landing page. Right-click the file and choose Edit File in Advanced Mode

Step 1a: Move the search box to the right place

Find the line that reads:

<asp:Content ContentPlaceHolderID="PlaceHolderTitleBreadcrumb" runat="server">

You want to cut the markup that is inside that content placeholder:

<SharePoint:UIVersionedContent UIVersion="3" runat="server">
<ContentTemplate>
<div style="height:100%; width:100%;padding-left: 18px; padding-top: 50px; padding-bottom: 10px;">
<center>
<div style="width: 510px">
<SPSWC:ListBoundTabStrip ID="Tab" runat="server" PersistQueryString="true" CSSClassNamePrefix="ms-sctab" ListName="<%$Resources:Microsoft.Office.Server.Search,SearchCenterOnet_SearchCenterListName%>" ResourceIdforListName="$Resources:Microsoft.Office.Server.Search,SearchCenterOnet_SearchCenterListName" UnselectedTabTrimLength="-1"></SPSWC:ListBoundTabStrip>
<div style="padding-top: 0px">
</ContentTemplate>
</SharePoint:UIVersionedContent>
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
<ContentTemplate>
<div class="srch-sb-main">
<div class="srch-sb-results4">
<div>
<SPSWC:ListBoundTabStrip ID="Tab1" runat="server" CSSFileName="Themable/search.css" PersistQueryString="true" CSSClassNamePrefix="ms-sctab" ListName="<%$Resources:Microsoft.Office.Server.Search,SearchCenterOnet_SearchCenterListName%>" ResourceIdforListName="$Resources:Microsoft.Office.Server.Search,SearchCenterOnet_SearchCenterListName" UnselectedTabTrimLength="-1"></SPSWC:ListBoundTabStrip>
</div>
<div class="srch-sb-results6">
</ContentTemplate>
</SharePoint:UIVersionedContent>
<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" FrameType="TitleBarOnly" Title="<%$Resources:Microsoft.Office.Server.Search,LayoutPageZone_TopZone%>" ID="TopZone" Orientation="Vertical" QuickAdd-GroupNames="Search" QuickAdd-ShowListsAndLibraries="false"><ZoneTemplate>
<WpNs0:SearchBoxEx runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{C00D0719-CF8A-47A2-9E31-FA3F6A38948F}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>Search Box</Title>
  <FrameType>None</FrameType>
  <Description>Displays a search box that allows users to search for information.</Description>
  <IsIncluded>true</IsIncluded>
  <ZoneID>TopZone</ZoneID>
  <PartOrder>1</PartOrder>
  <FrameState>Normal</FrameState>
  <Height />
  <Width>800px</Width>
  <AllowRemove>true</AllowRemove>
  <AllowZoneChange>true</AllowZoneChange>
  <AllowMinimize>true</AllowMinimize>
  <AllowConnect>true</AllowConnect>
  <AllowEdit>true</AllowEdit>
  <AllowHide>true</AllowHide>
  <IsVisible>true</IsVisible>
  <DetailLink />
  <HelpLink />
  <HelpMode>Modeless</HelpMode>
  <Dir>Default</Dir>
  <PartImageSmall />
  <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
  <PartImageLarge />
  <IsIncludedFilter />
  <ExportControlledProperties>true</ExportControlledProperties>
  <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
  <ID>g_c00d0719_cf8a_47a2_9e31_fa3f6a38948f</ID>
  <GoImageUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearch30.png</GoImageUrl>
  <GoImageUrlRTL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearchrtl30.png</GoImageUrlRTL>
  <GoImageActiveUrl xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearchhover30.png</GoImageActiveUrl>
  <GoImageActiveUrlRTL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/_layouts/images/gosearchrtlhover30.png</GoImageActiveUrlRTL>
  <ShowAdvancedSearch xmlns="urn:schemas-microsoft-com:SearchBoxEx">true</ShowAdvancedSearch>
  <DropDownModeEx xmlns="urn:schemas-microsoft-com:SearchBoxEx">HideScopeDD</DropDownModeEx>
  <IsMysiteSearchBox xmlns="urn:schemas-microsoft-com:SearchBoxEx">false</IsMysiteSearchBox>
  <TextBoxWidth xmlns="urn:schemas-microsoft-com:SearchBoxEx">368</TextBoxWidth>
  <ShowPerferenceLink xmlns="urn:schemas-microsoft-com:SearchBoxEx">true</ShowPerferenceLink>
  <ShowQuerySuggestions xmlns="urn:schemas-microsoft-com:SearchBoxEx">true</ShowQuerySuggestions>
  <SearchBoxVisual xmlns="urn:schemas-microsoft-com:SearchBoxEx">SearchCenterDefault</SearchBoxVisual>
  <AdvancedSearchPageURL xmlns="urn:schemas-microsoft-com:SearchBoxEx">/searchcentre/Pages/advanced.aspx</AdvancedSearchPageURL>
  <SearchResultPageURL xmlns="urn:schemas-microsoft-com:SearchBoxEx">results.aspx</SearchResultPageURL>
  <RegisterStyles xmlns="urn:schemas-microsoft-com:SearchBoxEx">true</RegisterStyles>
  <ShouldTakeFocusIfEmpty xmlns="urn:schemas-microsoft-com:SearchBoxEx">true</ShouldTakeFocusIfEmpty>
</WebPart>
</WpNs0:SearchBoxEx>
</ZoneTemplate></WebPartPages:WebPartZone>
</div>
</div>
<SharePoint:UIVersionedContent UIVersion="3" runat="server">
<ContentTemplate>
</center>
</ContentTemplate>
</SharePoint:UIVersionedContent>
</div>

That code needs to be pasted into the PlaceHolderMain content area, just after the markup to open the content area:

<asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">

Save the file and take a look, and you should see this:

edited search centre 1

It’s not quite right – everything’s shifted to the left. We’ll come back to that because it’s not fixable by editing the layout pages.

You’ll also notice that there are no breadcrumbs at all so no portal connection.

Step 1b: Fix the breadcrumbs

We’ll need to get the correct code for the breadcrumbs from another layout page. I grabbed it from the article page layout. It needs to go inside the PlacholderTitleBreadcrumb content area markup.

<SharePointWebControls:VersionedPlaceHolder UIVersion="3" runat="server">
<ContentTemplate>
<asp:SiteMapPath ID="siteMapPath" runat="server" SiteMapProvider="CurrentNavigation" RenderCurrentNodeAsLink="false" SkipLinkText="" CurrentNodeStyle-CssClass="current" NodeStyle-CssClass="ms-sitemapdirectional"/>
</ContentTemplate>
</SharePointWebControls:VersionedPlaceHolder>
<SharePointWebControls:UIVersionedContent UIVersion="4" runat="server">
<ContentTemplate>
<SharePointWebControls:ListSiteMapPath runat="server" SiteMapProviders="CurrentNavigation" RenderCurrentNodeAsLink="false" PathSeparator="" CssClass="s4-breadcrumb" NodeStyle-CssClass="s4-breadcrumbNode" CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode" RootNodeStyle-CssClass="s4-breadcrumbRootNode" NodeImageOffsetX=0 NodeImageOffsetY=353 NodeImageWidth=16 NodeImageHeight=16 NodeImageUrl="/_layouts/images/fgimg.png" HideInteriorRootNodes="true" SkipLinkText="" />
</ContentTemplate>
</SharePointWebControls:UIVersionedContent>

However, if you save the page and view it now you’ll get an error, because that markup references controls that the page doesn’t know about. In order to register them, we need to add a line into the section at the top of the page code that registers tag prefixes:

<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

The SearchMain.aspx layout page will  now work with the v4.master selected.

You’ll notice, however, that the ribbon isn’t quite right. That’s because it’s actually in twice – one in the v4.master and once in SearchMain.

Step 1c: Fix the ribbon

Find the following markup:

<asp:Content ContentPlaceHolderID="SPNavigation" runat="server">

After that line you’ll see another that reads:

<SharePoint:UIVersionedContent UIVersion="4" runat="server">

Right-click the tag and choose ‘select Tag’ from the context menu. Remove the highlighted code and you should be left with an empty SPNavigation content area. If you look at the page now, the ribbon works as it should.

Run through the same steps with the other search pages. I’m a bit paranoid, so whilst I’m pretty sure the content of the PlaceHolderTitleBreadcrumb is the same for all the layout pages, I always copy and paste the code within the page itself, then add the breadcrumb code afterwards.

You should now have a Search Centre that looks like this:

edited search centre 2edited searchresultsedited peopleresults

Step 2: Fix the master page

I said that the annoying shift to the right couldn’t be fixed in the layout pages. We need to edit the master page for that (and/or the styles if you like, but the master page is quicker for just one site).

Remember: Editing the v4.master page will prevent it being updated if Microsoft release SharePoint patches that include a new version, as we’ve modified the local copy in the site. If you want to be a good SharePoint admin, create a new master page for the search site!

This bit’s easy. Search for the line:

<div class="s4-ca s4-ca-dlgNoRibbon" id="MSO_ContentTable">

Edit it to read:

<div class="s4-ca s4-ca-dlgNoRibbon" id="MSO_ContentTable"  style="margin-left:0;">

All we’ve done is added a local styling rule to override the ones in the main stylesheets and set the left margin on that element to zero.

Save the master page and you should now get pages that look like this:

edited search centre 3edited searchresults 2edited peopleresults 2

Still to do…

Before you all shout at me, I know that the breadcrumbs don’t display like they ought to. I need to look into that – I remember reading somewhere that they work differently on pages in a page library than elsewhere. I need to do some research and see if I can fix that. Hey – isn’t ditching the minimal.master enough for you?

Next on the hit list – Access Services sites using minimal.master!

4. April 2011 13:57
by Rik Hepworth
0 Comments

Content Types programmatically added to SharePoint libraries not appearing on New menu

4. April 2011 13:57 by Rik Hepworth | 0 Comments

This one caused some consternation, I can tell you. As usual, the solution could be found on the great wide web, but it took some digging, so as usual I am repeating it here.

As part of a SharePoint migration we did recently, we replaced a SharePoint 2007 feature that the client was using (which added content types to libraries from a central list) with a mix of content type replication and PowerShell to add the content types to the libraries.

The code below scans through any site collections whose url begins with our $hostheader variable, then adds the list of content types to the Shared Document library in every web in the site collection. It’s a simple modification of some code on Phil Childs’ Get-SPScripts.com site and I take no credit for it – it’s all Phil’s work.

# Specify name of the library to look for in each site
#
$hostheader = "http://mywebapp*"
$lookForList = "Shared Documents"
#find our site collections and run through each in turn
# get all the site collections, then step into each site in each site collection
# find the list with the name in the var lookforlist
# then change content types on the list specified
#
# note - this will only find site collections where the url starts with the host header var
#
get-spsite where {$_.url -like $hostheader}| Get-SPWeb -Limit all | ForEach-Object {
    write-host "Checking site:"$_.Title
    #Make sure content types are allowed on the list specified
    $docLibrary = $_.Lists[$lookForList]
    if ($docLibrary -ne $null)
    {
        $docLibrary.ContentTypesEnabled = $true
        $docLibrary.Update()
        # Add site content types to the list
                # change the name in the quotes to the name of your content type
                #
        $ctToAdd = $site.RootWeb.ContentTypes["Word Document"]
        $ct = $docLibrary.ContentTypes.Add($ctToAdd)
        write-host "Content type" $ct.Name "added to list" $docLibrary.Title
                # 
        # Add second site content types to the list
                # change the name in the quotes to the name of your content type
                #
        $ctToAdd = $site.RootWeb.ContentTypes["Excel Spreadsheet"]
        $ct = $docLibrary.ContentTypes.Add($ctToAdd)
        write-host "Content type" $ct.Name "added to list" $docLibrary.Title
                # 
        # Add third site content types to the list
                # change the name in the quotes to the name of your content type
                #
        $ctToAdd = $site.RootWeb.ContentTypes["PowerPoint Presentation"]
        $ct = $docLibrary.ContentTypes.Add($ctToAdd)
        write-host "Content type" $ct.Name "added to list" $docLibrary.Title
                # 
        # Update the library object to commit changes
                #
        $docLibrary.Update()
    }
    else
    {
        write-host "The list" $lookForList "does not exist in site" $_.Title
    }
}

When we ran this through, however, whilst the content types were added correctly to the libraries, the New menu failed to list them.

Much (and I mean much!) digging revealed the cause to be down to a property in the library (spList.RootFolder.UniqueContentTypeOrder) that isn’t automatically set when we add the content types using code (which makes sense when you think about it…). However, all our fiddling with PowerShell failed to work. Adding a content type to the property (which is an array of content types) steadfastly refused to work.

We then found a post on the TechNet forums which appeared to give the answer in the form of C# code. We spent a long time on this, so to cut it short: You can’t simply add an item to the UniqueContentTypeOrder property – you have to set it to Null and rebuild it. The trouble is that in order to do that you have to stuff in an object that has an iList interface. Try as we might, we couldn’t create a PowerShell object that would allow us to store an array of ContentTypes and present the iList interface to the UniqueContentTypeOrder property to set the New menu values. Many people said that ArrayList or SortedList should do it, but they didn’t.

In the end, then I got our devs to knock up a rough and ready command line tool based on the code in the TechNet post. It’s really rough and ready, so I won’t post it here. Follow the posting and get your own tame devs to do the same. I only hope that this article becomes easier to find on the web to save you guys some time.

4. April 2011 13:31
by Rik Hepworth
0 Comments

Content type replication not working on imported or migrated site collections

4. April 2011 13:31 by Rik Hepworth | 0 Comments

A while ago I posted about a hidden feature that was needed if you want to use Managed Metadata columns in your SharePoint 2010 sites. We were doing some 2007-2010 migration work for a client recently that also involved exporting and importing sites and site collections to rework the content structure. Once we’d got the new structure sorted we discovered that content type replication was not occurring on the site collections we had imported. Some comparison of working and non-working SPSite properties with PowerShell later, we discovered that the culprit was the same hidden TaxonomyFieldAdded (ID 73ef14b1-13a9-416b-a9b5-ececa2b0604c) feature as I noted earlier. See my earlier post for instructions on enabling the feature.

As an addendum to my earlier post, which has code to enable the feature on a single site, Andy gave me the following snippet that will do it on all sites:

Get-SPSite -limit ALL |foreach{ Enable-SPFeature "73ef14b1-13a9-416b-a9b5-ececa2b0604c" -url $_.URL }

I don’t mind hidden features, per se, but when they’re not even logically named so I can associate them with their purpose, it’s annoying and time wasting. Why can’t we simply have a Content Type Subscriber feature that’s not hidden?

21. February 2011 16:53
by Rik Hepworth
0 Comments

Avviso Page Templates and Editing Video

21. February 2011 16:53 by Rik Hepworth | 0 Comments

We’ve just put a video of the page templates and editing process up on the AvvisoSharePoint YouTube channel. Our plan is to add more videos over time to show the different things Avviso can do. Enjoy!

Update: It seems our Community Server install blocks the embedded youtube object so you’ll need to follow the link to the video. Sorry.

15. February 2011 10:14
by Rik Hepworth
0 Comments

Demonstrating Avviso at NEBytes on 23rd February 2011

15. February 2011 10:14 by Rik Hepworth | 0 Comments

avvisohead

I am really chuffed to have been invited back to NEBytes for a follow-up to my last session on content publishing with SharePoint 2010. This time I’ll be demonstrating Avviso and talking about the thought processes that lead to its development, the problems we are trying to solve and where we’d like to go next.

If you’d like more information about Avviso, take a look at my recent post. To see more about NEBytes and their events, check out their web site.