2013-11-12

Alternative Lorem Ipsums

If you're lazy, like me, and also are bored with using the same Lorem Ipsum bla bla every time you mock up editorial text, you might want to take a look here. My favorite? Noone really, but I've always had a sweet spot in my heart for Bender so for now I'll stick to this one:

Take me to your leader! Switzerland is small and neutral! We are more like Germany, ambitious and misunderstood! And so we say goodbye to our beloved pet, Nibbler, who’s gone to a place where I, too, hope one day to go. The toilet. Anyhoo, your net-suits will allow you to experience Fry’s worm infested bowels as if you were actually wriggling through them.

EPiServer 7 unhandled error dread

Unhandled exceptions - what would life be without them? Probably wonderful, since they don't tell us much, or anything, about what went wrong.

I recently got the aforementioned error at a customer's live EPiServer 7 site. It fired after the user/editor logged in to the edit mode and then went back to the view mode, telling me that the QuickNavigator couldn't and wouldn't render as it was supposed to.

The stack trace concerning EPiServer said it crashed at EPiServer.Web.PageExtensions.QuickNavigator.RenderMenuScripts.

QuickNavigator menu scripts missing in action




After some digging around (not too much digging to be fair) I found that you need to set <runat="server"> for your <head> tag. After that you can merrily kiss that unhandled exception goodbye. Till next time, that is.

2013-11-04

Adding click tracking to SiteSeeker

If you are developing and implementing a SiteSeeker solution you are going to want to have click tracking functionality. Click tracking allows for the customer to see what searches actually generate clicks, since there might be a lot of searches that are dismissed (for instance by a new search) by the user.

Adding click tracking to SiteSeeker is quite a trivial thing to do. It is also absolutely necessary to have it installed since it allows for a more qualitative statistics follow up.

Steps

  1. First thing to do is to make sure that the click tracking javascript is loaded. This is done by calling the proper helper function. Add the following helper reference to your search page, or wherever it is you're loading the SiteSeeker javascripts:
    <%= helper.SiteSeeker_ClickTracking_Javascripts() %>
  2. Secondly, add the following within and at the top of the <body> tag:
    <input name="si" type="hidden" value="5CA571D509C386C581222CE02EB84FB1" />
  3. You also have to make sure that search result hits are rendered something like this:
    <div class="ess-searchResult" name="ess-responseId-XXXX">
    <ol>
    <li><a class="ess-hitLink" name="ess-hitNumber-XXXX" href="http://mysite.se/link1/" title="link1">Link 1</a></li>
    </ol>
    </div>
    This is done automatically if you use the standard result helper (helper.Result()). You're probably using a custom HTML helper for this which means you have to put the click tracking references there yourself. Note that ess-searchResult, ess-responseId-XXXX, ess-hitLink and ess-hitNumber-XXXX are necessary to render using those exact names.
The click tracking shows up in the SiteSeeker statistics. The image text is in Swedish; "Klick (%)" is the click percentage for each and every search term. If all of the click percentages show 0% something has gone wrong in the implementation. However, according to SiteSeeker it could take as long as 24 hours for clicks to get registered.

2013-10-30

Rich snippets 0x0x0x0x

Just testing some rich snippets. Hint: it involves extending page content by use of microdata and some html editing.
The Google crew has written a piece on this here.
"Example person" and "Example rating" should be displayed as normal text. However, if I Google this page I'm hoping to see the rich snippets in action.

Example person

My name is TC Brunzine, but people call me Brunzine. Here is my homepage: . I live in Falun, Sweden and work as an engineer at ACME Corp.

Example rating

Rating: 8.5

Continued

This is a nice overview and guide for getting started with rich snippets.

2013-02-07

Windows authentication fails on local site (0xc000006d)

When trying to log in via windows authentication, against a local site, I got a 401.1 Unauthorized error. This was unexpected since the site was a copy from another local site where the log in was working fine. By comparing the IIS settings they seemed to be duplicates.
The sweet 401.1 error message
One thing that differed though was that my newly copied site had a FQDN ("mirrorsource") with a corresponding entry in the HOSTS file, where as the original site URL was localhost. And after some digging I found this is by design an IIS issue with the purpose of handling reflection attacks.
HOSTS
Quoting a Microsoft KB,
"This issue occurs if you install Microsoft Windows XP Service Pack 2 (SP2) or Microsoft Windows Server 2003 Service Pack 1 (SP1). Windows XP SP2 and Windows Server 2003 SP1 include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name."

The solution is some registry hacking to avoid loopback check:
  1. Using regedit, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
  2. Add a new Multi-String Value to MSV1_0 and name it BackConnectionHostNames
  3. Add the host names you wish to use. In my case, "mirrorsource".
  4. Restart the IIS.
The registry entry should look something like this.