Tuesday, January 31, 2012

Dipping a Toe into Open Source Development

I spent some time this weekend shaping my Gutter Icon code into a proper Github repo:

  1. I took the class file and put it into a separate project.
  2. I replaced the old namespace "SitecorePlayground" with the more official  sounding "SharedSource".
  3. I serialized the Core content item that wires this up.
  4. I created a package with the DLL and and the content item, and tested them in a blank solution.
  5. I browsed among the various open source licences here and selected this one.
  6. I put the whole thing on Github and added a Wiki.
Next step, getting it on trac.sitecore.net!  A fair bit of work for 20 lines of code, but quite satisfying.  Please comment if you end up using this in your Sitecore installation.  

Monday, January 16, 2012

My Sitecore Personal Trainer: Stack Overflow

There's nothing like getting your ego invested in your Stack Overflow rating (mine is a puny 173 at present), to get you working on your technical chops. I spent a few (too many) hours working on this question:

Wednesday, January 11, 2012

Defining Multiple Sites in Sitecore's Host File

Just discovered an odd little fact about how the sites/site node works in Web.config when defining multiple sites. There is an implicit wildcard functionality, so that if you have two host names, such as "Sitecore65" and "Sitecore65b", a site with hostname="sitecore65" will match both.   So if you want "Sitecore65B" to go to a different home item form Sitecore65, you have to put this entry first in Web.config:


       <site name="website2" hostname="sitecore65b" virtualFolder="/" physicalFolder="/" ...
       <site name="website" hostname="sitecore65" virtualFolder="/" physicalFolder="/" ...
Sitecore's multisite documentation mentions wildcard functionality, but from the way it is stated, I assumed this was explicitly specified with an asterisk:
Sitecore compares the hostName attribute (which may include wildcards) with the incoming URL
Oh well, you known what they say about assuming things...