Getting Started With Sitecore Helix

In where I learn by doing

At Sitecore Symposium, Sitecore was very clear in defining their new architectural model as Helix. Habitat is just an example, one example, of a way to use Helix. Not THE way to use Helix.

For me, the best way to learn is by doing, and since what I am trying to learn is Helix, I am going to try and make an application from scratch using Helix. Ill build on top of a vanilla instance of Sitecore 8.2 and try and build a simple site on top of that, and Ill blog about my progress.

Create File System Structure

The first thing is to set up the folder structure on disk. They recommend having everything in an folder named src. This is fine. I’ve seen other projects (non-Sitecore) follow this principle also. Habitat places the solution file outside this src folder. Ill follow Habitats example for now. Does the solution file represent source code? Or structure? Not sure.

So right from the get go, my folder structure looks like:

  • HelixSample
    • src
      • Feature
      • Foundation
      • Project
    • HelixSample.sln

Visual Studio Solution Structure

Then I set up the folder structure inside Visual Studio, adding the Project, Feature and Foundation folders. Solution folders are virtual, not physical. So to get the structure inside my solution to match the file structure will take a little bit of discipline.

Sitecore Tree Structure

The next step is to set up some folders in Sitecore to match the Helix structure. Based on the docs, I set up Feature, Foundation and Project folders as follows:

  • /sitecore/templates/[Project|Feature|Foundation]
  • /sitecore/system/Settings/[Project|Feature|Foundation]
  • /sitecore/layout/renderings/[Project|Feature|Foundation]
  • /sitecore/layout/layouts/[Project|Feature|Foundation]
  • /sitecore/layout/placeholder settings/[Project|Feature|Foundation]
  • /sitecore/layout/models/[Project|Feature|Foundation]

So that’s three folders in each location.

At this point, I have a clean install of Sitecore, with just the suggested Helix folders, and a very basic Visual Studio solution, so its time to add some serialization, and then store this in source control. Ill tag that check-in as my starting point. I look at setting up Unicorn for serialization in my next post.