While looking for a fix to my TestDriven.Net problem (couldn’t get it to run all Xunit tests in a class or assembly), I came across an open question on Stack Overflow from a developer having the same problem. For some reason I felt compelled to answer this question once I found the answer. After a bit of searching and registry browsing, I found out that I needed to move a registry key from the Wow6432node to the “regular” section of the registry.
So back to Stack Overflow I went to answer. This being the first time I’ve answered anything on there, I figured I should sign up so I get “credit” for my one whole answer. While I have a couple of accounts from other places that support open ID, I felt that claiming my blog URL would be the techie thing to do.
I picked Claim Id from a list of open id providers because I thought Scott Hanselman recommended it, but couldn’t remember for sure, but it looked ok. Sign up was easy, and they even provided instructions for claiming my blog URL, including the HTML code, complete with my username. If you view the source of my blog page, you will see the following two lines in the <Head> section.
<link rel=”openid.server” href=”http://openid.claimid.com/server” />
<link rel=”openid.delegate” href=”http://openid.claimid.com/asalvo” />
In DasBlog, I added these to lines to the homeTemplate.blogtemplate file for my current theme. This is also where I placed the code to enable Google Analytics awhile back. Speaking of Google, I came across their Ajax API which I talked about briefly, and though as long as I’m in here editing for openId, might as well try adding the search functionality.
At this point it’s close to 2am, and I started this around 10:30pm. The whole ajax google search turned into a real chore to get working even close to the way I would like it. However, since I invested all this time into it, I felt like leaving it as is for now. There are some CSS entries needed to get the results to show up where they do on my page, so if you want, take a look at my CSS file as well (the relevant stuff is at the top under center column stuff).
I’d like to revisit this post when I update my theme, hopefully in the near future.
Final Script located in the head section (feel free to view source on this page as well)
<script src=”http://www.google.com/jsapi?key=YourKey” type=”text/javascript”></script>
google.load(‘search’, ’1.0′);
function OnLoad() {
var controlRoot = document.getElementById(“searchControl”);// create the search control
coreSearch = new GSearchControl();
coreSearch.setLinkTarget(GSearch.LINK_TARGET_SELF);
coreSearch.setResultSetSize(GSearch.LARGE_RESULTSET);// prep for decoupled search form
var searchFormElement = document.getElementById(“searchform”);
var drawOptions = new GdrawOptions();
drawOptions.setSearchFormRoot(searchFormElement);
drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);// populate – web, this blog, all blogs
var searcher = new GwebSearch();
searcher.setSiteRestriction(“http://blog.salvoz.com/”);
searcher.setUserDefinedLabel(“Salvoz Blog”);
coreSearch.addSearcher(searcher);
searcher = new GwebSearch();
searcher.setUserDefinedLabel(“The Web”);
coreSearch.addSearcher(searcher);coreSearch.draw(controlRoot, drawOptions);
}
function doCoreSearch(q) {
coreSearch.execute(q);
}
google.setOnLoadCallback(OnLoad, true);</script>