Creating Sitecore Items with a Specific ID with SPE

I recently needed to re-create an item that had been deleted by accident and was no longer available in the recycling bin or anywhere else. However this item needed to be created again with the same Id to avoid a lot of re-configuration.

I figured I might be able to do this with SPE (Sitecore Powershell Extensions) and after some digging it turns out there is a ForceId param supported by the ‘New Item‘ function that I hadn’t come across before.

It can be used like so – note: the -ForceId parameter that you will need to update to the Item Id you wish to use:

Once you’ve run this command you should see an item created with the Id you set as below:

add-item-with-new-id

 

 

 

 

 

 

 

I haven’t seen any other blog posts on this so hopefully it’s useful for anyone else who needs to do this in future.

Building Components in Sitecore 10 with the ASP.NET Rendering SDK

Last Thursday I presented at the London Sitecore User Group Online. This was the first online UK Sitecore user group this  year, which was a response to the Covid-19 Pandemic.

I Demo’ed how to Build ASP.Net Core Components in Sitecore 10 with the ASP.Net Rendering SDK.  The Demo uses a modified version of the Getting Started template to do this. An overview of the ASP.Net Rendering SDK is also provided and some useful Tips too.

Video Of Presentation

You can find a pre-recording of my presentation on my YouTube Channel here:

Steps To Build a Component in Sitecore 10

Bellow I’m going to detail the steps involved with Building a component in Sitecore 10 using the ASP.Net Rendering SDK. These are covered in the video but I thought it would be useful to write them down too and provide some further information where applicable.

Development Environment Setup

The first step is to get a Sitecore 10 Development environment setup. For my demo video above I used the getting started template. The Demo Video and this Overview starts from the point of having this installed. You could use docker and install everything yourself or install Sitecore 10 directly on your local development environment instead. However you would need to create your own Visual Studio project for the Rendering Host so this is more complex if you are just looking to experiment with this like I was.

Fellow MVP Robbert Hock has a really helpful video on getting the getting started template all setup and working so I’m not going to go into this further here: https://www.kayee.nl/2020/09/25/getting-started-with-sitecore-headless-development-asp-net-core-docker-containers/

note: to use the new ASP.Net Rendering Host SDK you will need to have access to the Layout Service within your Sitecore Licence, I believe currently this means you need JSS included in your licence.

I modified the Getting Started Template a little to include Bootstrap 4, some custom CSS and some new placeholders and components to make things a bit more interesting, but other than that my demo follows this fairly closely.

mandalorian

Building a Card Component

As covered in the demo we are going to build a Card Component (part of bootstrap) and follow a similar approach to the official documentation example for building a component. Assuming you’ve installed the getting started Template with the defaults the Sitecore CM instance will be visible here: https://cm.myproject.localhost/sitecore. If you wish you can add bootstrap 4 from here to the layout file in the Getting Started Template so that what you see will look more similar to the screen shot above. After completing all the steps below you could cerement your knowledge by adding an hero and some other components too (like I have above).

UPDATE (16/12/2020): 
I got asked if my version is available when I presented this at the Pittsburgh SUG Recently so I've uploaded it to Github here for those that want to replicate the look and feel of my demo or look at the code I used.

This version also uses Rich text for the Text field and and includes an image field: https://github.com/fluxdigital/Mandalorian.Sitecore.NetCore
mandalorian-netcore-demo

Create the Data Template

Create an data template called Card in the following location: /sitecore/templates/Project/MyProject. I called the data field section ‘Card Data’ but you can call it what you want.

Add the following 3 fields and set an icon:

  • Title  – Single Line Text Field
  • Text – Multiline Text Field
  • Link – General Link Field

template

Create the Json Rendering

Create a new rendering using the ‘Json Rendering’ template called Card in the following location: /sitecore/layout/Renderings/Project/MyProject/Card. Leave the Component name as ‘Card’.

rendering

Set the Datasource Location to: ./ ,set the template to the Card template you just created and set an icon:

rendering2

Create a New Placeholder

Create an new placeholder called myproject-container in the following location: /sitecore/layout/Placeholder Settings/Project/MyProject. Add the Card to the allowed controls.

placeholder

Add to Layout Service placeholders

The layout used by the Home item is as follow: sitecore/content/MyProject/Home. We need to Tell the layout service to return the placeholder.

Open the layout here: /sitecore/layout/Layouts/Project/MyProject/Main and add the myproject-container placeholder to the layout service placeholders field.

layoutservice

There is documentation on this here but it’s not 100% clear that this also applies to renderings: https://doc.sitecore.com/developers/100/developer-tools/en/layout-and-site-requirements-for-asp-net-core-rendering.html.

Add the Card Item in Sitecore

Add Card Item under the Home Item and populate the fields with some data.

demo-card

Add the Card to the Page

Open home item in Experience Editor and add the card to the placeholder and save the page.

exp

You will not see the card appear and will probably show an error message in place of the card at this point as we have yet to build the Component in Visual Studio and inform the Rendering Engine about our Component.

unknown

Publish the Site

Within the CM Smart Publish the Site.

publish

View Layout Service Debugging

Within the console you can Show the layout service response by typing the following command:

docker-compose logs -f rendering

docker

If you scroll down the logs you should see an empty response in the layout service for the myproject-container as we need to do some work in Visual Studio now to get this working.

Create the Model

Within Visual Studio Create a new Model called CardModel at the following location: rendering\Models with the following contents:

 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
 using Sitecore.LayoutService.Client.Response.Model.Fields;
 namespace MyProject.Models
 {
   public class CardModel
   {
    public TextField Title { get; set; }
    public TextField Text { get; set; }
    public HyperLinkField Link { get; set; }
   }
 }

Note we are not using GlassMapper here we are using the new LayoutService Field Model. We use the TextField and HyperLinkFields for our Model.

Create the View

Create a new view called Card.cshtml within the following folder: rendering\Views\Shared\Components\SitecoreComponent\.

Add the following mark-up to include the 3 fields we created on our template earlier:

 @model MyProject.Models.CardModel
 <div class="card">
   <div class="card-body">
    <h2 class="card-title" asp-for="Title"></h2>
    <p class="card-text" asp-for="Text"></p>
    <sc-link asp-for="Link" class="btn btn-primary" editable="true"></sc-link>
  </div>
 </div>

Add Rendering Engine Binding

Within the Statup.cs file add the following line in bold to register the Card Model and Card View with the Rendering Engine.

// Register the Sitecore Rendering Engine services.
 services.AddSitecoreRenderingEngine(options =>
 {
 //Register your components here
 options
 .AddModelBoundView<CardModel>("Card")
 .AddDefaultPartialView("_ComponentNotFound");
 })

Add Placeholder to the Index Page

Update the index.cshtml layout file (rendering\Views\Default\Index.cshtml) to match the following. The main change here is to add the myproject-container placeholder:

 @model PageModel 
 @{
    ViewData["Title"] = Model.Title?.Value ?? string.Empty;
 }
 <main role="main">
    <sc-placeholder name="myproject-main"></sc-placeholder>
    <div class="container">
     <div class="row">
      <div class="col-md-8">
         <sc-placeholder name="myproject-container"></sc-placeholder>
      </div>
     </div>
   </div>
 </main>
 <nav class="navbar fixed-bottom navbar-expand-sm navbar-dark bg-dark" style="color: #fff;">
 &copy; @Model.CopyrightYear
 </nav>

Build the Project

Save and build the project to deploy the changes to the Rendering Host. As the Rendering Host is configured to use dotnet watch it should build and deploy the changes to the rendering host on save, so an build shouldn’t be needed really.

vs

View the page

Refresh the published page (by default: https://www.myproject.localhost/) to view the Updated home showing the new card component.

final-card

Your card may look a little different to this but it should be similar. Well done you’ve just built your first component in Sitecore 10 :-).

Tips

There are a few tips I picked up during my experimenting with this.

  • Check the Docker Console & Logs for errors if you are having problems:

    docker-compose logs -f rendering

  • If you have issues with Rendering Host or CM not updating then restart them both like so (docker can assign a new IP if you don’t restart both):

    docker-compose restart rendering cm

  • Read Up On Tag Helpers – https://doc.sitecore.com/developers/100/developer-tools/en/tag-helpers.html

Hopefully the video of my presentation and overview are useful for those who are considering using this new functionality in Sitecore 10 or are interested in knowing more about how this works.

Lastly thanks to Nick Wesselman for his help with some issues I had along the way and some diagrams for presentation.

Sitecore Symposium 2020 Highlights

sym-2020-banner

On Tuesday and Wednesday last week it was Sitecore Symposium 2020. This year it was all on-line so was a bit different and that was great in terms of catching up on all the content but not so great from a networking and social perspective.

I normally write a fairly detailed over-view of what I learned in the sessions over the 2-3 days; partly to share what I learned with others but also so I don’t forget what I learned either by the time I get back to the UK.
However this time round as most of the sessions are available on https://sym.sitecore.com/ you can watch a lot of it yourself if you missed it. I had an ‘All Access Pass’ so you will need to upgrade to view some of the content I saw.

So instead I’m going to summarise the 6 key themes over the 2 days instead with some links to key sessions I watched. I’ve kept the slides below to a minimum, but please check out my Twitter feed for more screen shots.

1. Pandemic Impact & Agility

The Pandemic has changed how customers expect to interact with brands and companies have had to respond very quickly to rapidly changing customer needs. In the opening Keynote and theme throughout Symposium was that a “Moment to Moment” Mindset is what is required to meet customers needs in these moments and how Sitecore’s innovations can help with achieving this.

Screenshot 2020-10-30 202449

Brands need to move a lot faster in the current climate and solve their internal operational challenges responds quickly to customers.

Screenshot 2020-10-30 203657

2. Auto Personalisation

The new Sitecore CEO Steve Tzikakis announced that all Sitecore 10 customers would receive access to Auto Personalisation Standard at no additional cost. This is clearly a key innovation for Sitecore going forwards.

Screenshot 2020-10-30 204102

There were some demos of this in action across the various sessions and It looks pretty cool. It could certainly take away a lot of the heavy lifting needed for personalisation and allow content editors to focus on other tasks configured and trained correctly.

Screenshot 2020-10-28 104748

We saw an example of how this works, how you can identify (and fix) customer ‘clusters’ which have gaps in personalisation and an example of the dashboard you would see showing performance and other metrics.

Screenshot 2020-10-28 104134

Screenshot 2020-10-28 104409

3. Content as a Service (CaaS)

Steve Tzikakis also announced that CaaS would be available in both managed cloud and Public Cloud. CaaS will deliver Sitecore content to any digital channel required, providing direct access to content in a decoupled way, allowing for faster development and delivery.

Screenshot 2020-10-27 232144

Screenshot 2020-10-27 213844

In a later CaaS preview session by Alistair Deneys & Andy Cohen we were given a lot more insight into how this will work and also told that it will not require Content Hub to work either as CaaS can be used directly against Sitecore too (via the JSS Layout Service). It’s great to see a full Headless offering from Sitecore using GraphQL to access the data and support for Next.Js too.

Screenshot 2020-10-27 214334

4. Content Hub

There were a lot of mention of Content Hub at Symposium this year, Jake the compère and comedian (who was pretty funny still despite having no live audience) joked that we should drink each time we here it.  I guess it makes sense we’d hear it a lot as Content Hub is a the Centre of Sitecore’s SaaS approach.
For those that don’t know Sitecore Aquired Content Hub (then Stylelabs) in 2018 and it both an DAM, PCM and CMs with lots of impressive functionality for managing and organising content for all channels in a single location.

Screenshot 2020-10-27 212222

Screenshot 2020-10-27 212423

It was really interesting is to see how Sitecore are using Content Hub for Sitecore.com and the challenges they faced.

Screenshot 2020-10-27 212858

One of the other sessions I watched on Content Hub was from Fellow Sitecore MVP Akshay Sura from Konabos and Sumith Damodaran from Sitecore. This talk was regarding how the new Content Hub Connector allows Sitecore Customers to integrate content from Sitecore XP into Content Hub where they can organise, collaborate and personalise content before distribution.

Screenshot 2020-11-01 191918

It was interesting to see how Sitecore fields are mapped on the Sitecore Template to the fields in Content Hub in the CMP connector and then how this displays in Content Hub.

Screenshot 2020-11-01 191653

CMP is available for Sitecore 9.2 and 9.3 currently and it may be merged with the DAM Connector in an upcoming release.

Screenshot 2020-11-01 192218

5. Containers are the Future

Container support was released as part of the new DevEx with Sitecore 10 and it will soon become the defacto way to develop locally for Sitecore. Whilst Containers do bring some complexity they also provide a lot of benefits such as portability, consistancy, being able to quickly destroy and re-create Sitecore instances and having multiple client instances or versions on a single machine.

Screenshot 2020-10-28 114955

However another one of the drivers for using containers is that they can be used in Production and you will soon be able to deploy to AWS, Google Cloud, your own Cluster or AKS! This means you will no be tied to Azure App Services.

As I understand it App Service Support will be marked as obsolete in Sitecore 10.1 and removed in Sitecore 10.2. This isn’t that Sitecore won’t work in App Services anymore but more that ARM templates will not be provided anymore and Support for Sitecore in App Services may be limited.

The session by Bart Plasmeijer and Rob Earlam on how to create an AKS Cluster, Windows Node Pool & deploy an Sitecore instance into it was really insightful. They managed to do all this within 20 minutes.

Screenshot 2020-10-28 115215

It was also really interesting to see some of the tooling in action like
@k8slens and K9s showing how they work and the features they provide.

Screenshot 2020-10-28 115726

Screenshot 2020-10-28 121157

There is another on-demand session on this too which was really informative around what the benefits are for Kubernetes for various roles in an organisation.

Screenshot 2020-10-30 223113

6. New Sitecore DevEx

A significant part of the Sitecore 10 release was the new Sitecore Development Experience (DevEx).
As well as containers for development one of the other new features is the availability of an new serialization option, which comes as standard with Sitecore. There are two flavours of this: the Sitecore CLI (using JSON) Or the GUI (Sitecore for VS). The CLI is free where as Sitecore for VS requires an (TDS) licence.

Screenshot 2020-10-27 204024

I saw an demo of this and it looked really interesting. I’ve tried it out myself too and it works really well. I’m interested to see if there are any features missing that unicorn or TDS have. It does look like Sitecore have most things covered though with the rules support.

Screenshot 2020-10-27 205944

Another part of the new DexEx is the new ASP.Net Core Rendering SDK which I saw an session on. This is a new way of building Sitecore sites in Sitecore 10.x, allowing you to use Layout Service to return content from Sitecore to display using .Net Core Components using Tag Helpers.

Screenshot 2020-10-28 200803

This approach has full support for Sitecore features such as editing in Experience Editor and also Analytics and Testing.

Screenshot 2020-11-01 185152

Nick also explained the .Net Core Request Pipeline works with the SDK, this is shown in the diagram below. It looks a little complicated but makes sense once you break it down.

Screenshot 2020-10-28 192411

There is a lot of new stuff to learn here but it’s great to see .Net Core support and another option available for Sitecore development. I’m learning more about this currently and plan to share what I learn in the near future.

It’s a wrap

The closing keynote with Leslie Odom Jr was entertaining and there were a lot of other on-demand sessions I watched too. It was really cool to hear that the next Symposium is going to be in Vegas next year :-), Hopefully I’ll see some of you there.

Screenshot 2020-10-28 215116

Screenshot 2020-10-28 215922

Thanks to Sitecore and the speakers for putting on another great event and for making it so accessible. Lets hope the Sitecore Community can meet up in Person in 2021!.

My Sitecore Symposium 2020 Agenda

lonely-road-3

It’s Sitecore Symposium this week and It’s going to be a bit different this year. I attend Symposium in the USA most years and I’d usually be boarding a plane about now, this year (if it wasn’t for COVID-19) I’d be heading to Chicago. Instead the entire conference is Digital.

This means unfortunately I won’t get to catch-up with others in the Sitecore Community in person or get to do a bit of travelling which is a shame.
However there are some benefits though (other than it being a whole lot cheaper) which is that there a a lot of on-demand and breakout sessions which (if you purchase an all-access pass like I have) I believe you can access after the event. So unlike in the real-world you can catch up on sessions you’ve missed, in-light of this I’ve sometimes selected more than one clashing session.
An additional benefit I guess you’ll probably not have a hangover for those early Morning sessions either :-).

Anyway I’m looking forward to Sym and thought I’d share the sessions I’m playing on attending and why. You can find the full agenda here.

  Day 1 – Tue 27th


» 10:20 – 10:50am (CDT) – Sitecore business update with CEO Steve Tzikakis

Steve Tzikakis – Chief Executive Officer – Sitecore

– This is the first opportunity to listen to Sitecore’s now CEO. I’m looking forward to hearing what Steve has to say and his plans for the future.


» 11:45am – 12:45pm (CDT) – Influencer Roundtable with Microsoft: Integrating AI into your existing digital marketing strategy

Colin Wright – Director Strategy – Microsoft
Jonathan Weindel – Advanced Analytics Manager – Microsoft
Wina Wichienwidhtaya – MarTech Strategist – Microsoft Corporation

– I’m interested in seeing how other Sitecore customers are using AI and gaining further insights from Microsoft.


» 12:50 – 1:15pm (CDT) – Premium general session: The Road to Product Innovation

Desta Price – EVP Product Management – Sitecore
Tom De Ridder – Chief Technology Officer – Sitecore

– This is an all-access pass session and looks like it will give some insight into Sitecore’s plans for the future as well as the latest innovation’s in Sitecore 10. 


» 1:45 – 2:15pm (CDT) – Serialize your way to success

Charlie Turano – Product Manager – Sitecore

– I’ve installed Sitecore 10 and experimented with the new Seralization features but I’m looking forward to learning more about it.

OR

» 1:45 – 2:15pm (CDT) – 2020 and beyond: Integrating Sitecore with emerging technologies to wow your customers
Brian Henderson – Sitecore Architect – XCentium
Julia Gavrilova – Technical Director – XCentium

– Using Sitecore to power and Personalise 3D and AR technology sounds pretty cool to me so I’m intrigued to find out more.


» 2:20—2:50pm (CDT) – Real-time personalization in a true omnichannel world using JSS and Azure

Bas Lijten – Principal Architect – Achmea

– This sounds like an interesting approach and use of some of Sitecore’s newer features to fulfil some complex requirements.


» 3:10 – 3:40pm (CDT) – Containers & AKS: Taking Sitecore 10 to the next level

Bart Plasmeijer – Senior Software Architect – Sitecore
Rob Earlam – Technical Evangelist – Sitecore

– I’ve played around with the Docker examples for Sitecore 10 and have been impressed how quick and easy it is to spin up a development instance with Docker. I’m looking forward to hearing more and seeing how AKS can be used with Sitecore.

OR

» 3:10 – 3:40pm (CDT) – Content as a Service: A preview
Alistair Deneys – System Architect – Sitecore
Andy Cohen – System Architect – Sitecore

– I’m always keen to learn more about new Sitecore features so this session regarding Content as a Service (CaaS) should be interesting.

OR

» 3:10 – 3:40pm (CDT) – Insufficient facts always invite danger, Captain!
Neil Killen – Technical Director – Valtech

– Monitoring and performance of Containerized environments is all new to me so I’m looking forward to learning more about this.

  DAY 2 – Wed 28th


» 12:05 – 12:35pm (CDT) – Data privacy and Sitecore

Rob Habraken – CTO – We are you

– GDPR is tricky subject so I’m going to drop in on this session to make sure I understand all the touch-points to consider in Sitecore for the right to be forgotten.


» 12:40 – 1:10pm (CDT) – Sitecore AI: Auto Personalization Standard for Sitecore 10

Marcos Guimaraes – VP, Chief Data Scientist – Sitecore
Nancy Lee  – Principal Product Manager – Sitecore

– I’ve not really seen the Auto Personalisation in Sitecore 10 in action so I’m interested in learning more about this.

OR

» 12:40—1:10pm (CDT) – How to develop with the new ASP.NET Core rendering SDK
Nick Wesselman – PM, Developer Experience – Sitecore
Oleg Jytnik – Technical Lead – Sitecore

– I’ve been experimenting with the new ASP.NET Core rending SDK using the examples on https://doc.sitecore.com, but I’ve got a lot to learn still so I’m really looking forward to this session.

~ At this juncture I might do some yoga…no your right I probably won’t. I’ll likely just go and see if we’ve got any more biscuits in the cupboard instead. I’m just checking you’re still awake :-). ~

» 1.30 – 2.00PM (CDT) – Content Orchestration: A symphony between Content HUB and Sitecore XP using Content Hub Connector
Akshay Sura – Lead Platform Architect – Konabos Consulting
Sumith Damodaran – Sr. Product Manager – Sitecore

– Fellow MVP Akshay has been doing  a lot with Content Hub over the past few months so it will be great to learn more about Content Hub and Content Hub Connector.

OR

» 1:30—2:00pm (CDT) – Choosing the right option for building your Helix solutions
Shelley Benhoff – Lead Developer and Author – The Berndt Group

– Shelly has written some great Pluralsight courses so this session is bound to be informative.

» 2:45—3:45pm (CDT) – Failing Up: How to Take Risks, Aim Higher, and Never Stop Learning / Closing remarks with Paige
Leslie Odom Jr – Tony and Grammy Award-Winning Performer

Paige O’Neill – CMO – Sitecore

– The closing session of Symposium should be interesting and entertaining too.

On Demand

On top of all the live content there is a heap of On-Demand content too, I’m planning on watching some additional sessions on SOLR, SXA, Kubernetes, Content Hub, JSS, Upgrades and there are loads more for you to watch besides these.

It’s just as well I’ve taken 3 days off work to learn all of this. If you haven’t got a ticket yet then I think you can still grab one here. You’ll be missing out on a lot of interesting stuff if you don’t.

Bulk Adding Captchas to WFFM Forms with Sitecore Powershell Extensions

Last week we had some Robots submitting a lot of WFFM forms across the website, creating thousands of submissions. I knew the quickest way to solve this was to add the out of the box CAPTCHA to the forms. However we had to put a solution in place quickly but with over 350 form instances across the website this needed a automated solution.

star-wars-robots-blured

I immediately thought SPE might come to the rescue here (as it often does), so  had a look on Google/SSE etc but couldn’t see anyone else who’d done this. So I fired up SPE and the following script is what I ended up with:

Add a CAPTCHA to all WFFM Forms with SPE

google-recaptcha

The script recursively loops through all the forms in the root folder set in script and checks if a CAPTCHA exists on the form already. If it doesn’t find one, it creates one as the last field in the form using the settings defined in the script. You can easily update any of the field settings to your liking such as the name and if it’s required etc.
It could also be modified to filter forms based on criteria such as name, folder or send/save actions if required too.

I hope this is useful for someone else in the future.

Automate Adding Experience Editor Buttons to Renderings with SPE

I had an situation last week where I needed to add a experience editor button to all components and we have 63 of them. So Instead of doing this manually I decided to see if I can do this easily with SPE.

The other thing I had to consider is that most renderings had some custom experience editor buttons already, so I needed to make sure these were maintained.

exp-editor-button

Also I only wanted to add the button if there was a datasource set as it is only relevent to components with buttons.

It turns out this wasn’t that tricky and this same script could be used to populate any multi-list field, such as auto-setting the compatible renderings:

add-exp-editor-button-spe

Show Me The Script Already

Hopefully someone else will find this useful too.

Creating Microsites In Sitecore without SXA

dynamic-sites-globe2

I’ve not used SXA in anger but have heard good things about it. Unfortunately due to licencing and timeframes it was not an option for me on a recent project where I was required to recommend and deliver an mechanism for quickly creating Microsites in Sitecore.

TLDR: If SXA is not an option then Dynamic Sites Manager might be a good alternative for you.

This meant I had 3 options:

1) Manual Configuration in the Sitecore Config
2) Use a Sitecore Microsite Module (such as the Multiple Sites Manager)
3) Write something custom to support adding Microsites dynamically

Manual Config wasn’t really an option as I knew that we had a number of Microsites to add and having a more flexible approach with less work and maintenance involved was important. I also didn’t want to write something custom as I knew this would be a time-sink involving solving problems other people have already had to with one of the Sitecore Modules available.

Dynamic Sites Manager To The Rescue

After a fair amount of research and experimentation I decided upon an lesser known Module called Dynamic Sites Manager built by Pete Navarra. As we are using Sitecore 8.2 I decided to use this specific version (1.9.1) from Github.
This happens to be the most recent release of the Module. It does work with Sitecore 9.0 too.

Pete has written one or two posts on the Dynamic Sites Manager but during the setup and of the module and configuration of the various sites I learned some useful tips I thought I’d share. On the project I’m currently working on we have two Sites that are live using the Dynamic Sites Module so far and both are functioning well.
Pete was also really helpful on Slack fielding all my questions so I wanted to return the favour and blog about it.

Reasons I chose Dynamic Sites Manager

  • It’s been written for performance, it uses the Site Provider Pattern and doesn’t just hook into the HttpBeginRequest pipeline (like the Multiple Sites Manager does) – this can cause caching issues
  • Microsites an be added and (most) configuration implemented purely within Sitecore
  • Each Microsite has a number of settings that mimic native Sitecore config for a Site
  • Content for the Microsites can be created wherever you wish
  • Roles can be configured for Microsite content as normal in Sitecore
  • Existing Layouts, Components and functionality already created in Sitecore can be used in Microsites
  • The module works with Sitecore 8.2, has been around for a few years and has had 8 releases so is quite mature.
  • I tested the module with Sitecore 9.0 today and it works so when we upgrade to 9.x It should continue to work correctly.
  • The code is open source on Github so we can fork it and change anything if we need to
  • It has been battle-tested on large sites with 100s of Microsites

Installing the Module

The first step is to download and install the Module. You can download it from the Market Place. The direct link for 1.9.1 is here.

Install the module using the package installation wizard as normal.

dynamic-sites-1.9-install-2

Once the module installation has completed open the DynamicSites.config.example config file  here: /App_Config/Includes/X.SharedSourceModules and rename  to DynamicSites.config.

dynamic-sites-1.9-install-3

 

 

 

 

 

This will enable the module and configure the default settings for the module, as defined at the top of the file this config file adds:

1) Event Handlers to Update Custom Chosen Templates with Dynamic Sites Base Template
2) Site Providers for both Dynamic Sites as well as a Switcher Provider.
3) Dyanamic Site Default Settings. All Dynamic Sites will inherit from these default properties.
4) 4 Sitecore Settings.

I’d recommend leaving this as it is for now and coming back to tweak settings if you need to.

Module Configuration

The next steps are to configure the module settings within Sitecore and create your first Dynamic Site.

You can set some general settings if you wish for the module here: /sitecore/System/Modules/Dynamic Sites/Dynamic Site Settings. You will probably find you can just leave most of the default settings here ‘as is’.

One thing you may want to consider doing is updating the Site Definition Template. The dropdown highlighted below allows you to set a custom template as the Site Definition template. This adds a Dynamic Site Definition Base template to the item and allows site configuration to occur on the item level:

dynamic-sites-1.9-install-4

This will likely be if you wish to customise the configuration settings in future.

For now you can just continue with using the Site Definition Template that ships out of the box with the Module.

Creating A Dynamic Site

For this example I’m going to do this on my local machine but if this was on another environment the process would be very similar. I have a site called ‘Demo Site 1’ which I’ll use for this example:

dynamic-sites-1.9-install-6

  1. Go to: /sitecore/system/Modules/Dynamic Sites/Sites
  2. Right click on the folder to Insert a new Dynamic Site Definition (I called mine ‘Demo Site 1’)
  3. Configure the Key Settings for your Site such as:
    – Hostname – the url which will be used for your Site
    Home Item – the Home item of your site (In my case: /sitecore/content/Demo Site 1)
    Port – this will be (I hope!) 443 for Live but locally you may be using Port 80 perhaps. If you using a self signed cert locally you can use 443 locally too.
    Database – this will likely be web for local testing (depending on if you want to view the published or un-published content)dynamic-sites-1.9-install-7

    Dynamic Site Custom Properties – you can over-ride any settings you wish that are usually on the <site> node in the Sitecore config here or you can add any custom properties you need to support. For example I had a custom cdn url property that I added which you can see below.dynamic-sites-1.9-install-8
  4. Add your binding in IIS to your Sitecore site, this is my local Sitecore 8.2 u7 instance:
    dynamic-sites-1.9-install-9
  5. Add a host file entry to the Site (on another environment this would obviously be handled with a DNS).
  6. Ensure your Website Homepage is in it’s final workflow step and Published. If all is well you should then see the webpage if you visit it in your browser (e.g: http://demosite1.local)

dynamic-sites-1.9-install-5

Supporting Preview / Published Sites

Our content editors wanted to be able to preview their content on the CM (Master) before publishing to CD (Web). I wasn’t sure on how best to handle this scenario so I reached out to Pete on Slack and he was really Helpful.

It turns out the best way to set this up is to create two Site Definition items, one for CM and one for CD. Both sites should have the Home Item set as the same (most other settings will be the same also).

The CM Site Definition item needs to be at the top of the list (above the CD Site Definition item – so it resolves first on the CM) and be set as un-publishable. Note I’ve pre-fixed my Site Definitions with CM and CD to easily identify them:

dynamic-sites-1.9-install-11

 

You then need to configure a different hostname for the CM Site (e.g: master.demosite1.local). If all is well you should be able to view the master site and see differences in the Master content:

dynamic-sites-1.9-install-12

Other Considerations

WFFM

One of the stumbling blocks I came across is that when configuring the default Web Forms For Marketeers form folder I got an error as it couldn’t find an ID. The issue was that I was including the brackets within the config in the Site Definition. Therefore ensure you remove the brackets like so:

dynamic-wffm

Unicorn

If you use Unicorn to sync your Sitecore items across environments. You may wish to sync your Dynamic sites and content via Uncorn. I settled on 2 different configurations to handle this.

A new items only configuration to deploy the Main Site Home Item only one like so (this is redacted):

<configuration name="Dynamic Sites New Items Only" description="Unicorn Config for new Dynamic sites items only (Existing items, deleted items or changed items are ignored)">
 <evaluator type="Unicorn.Evaluators.NewItemOnlyEvaluator, Unicorn" singleInstance="true"/>
 <dataProviderConfiguration enableTransparentSync="false" />
 <predicate>
 <include name="DynamicSitesNewItemsOnlyDemoSite1" database="master" path="/sitecore/content/Demo Site 1/Home">
 <exclude children="true"/>
 </include>
 </predicate>
 <dataProviderConfiguration enableTransparentSync="false" />
 <syncConfiguration updateLinkDatabase="true" updateSearchIndex="true" />
</configuration>

A main configuration to deploy component content folders and setting items to the site likes so (this is redacted):

<configuration name="DynamicSites" description="Unicorn Config for DynamicSites Items">
<predicate>
 <exclude path="/sitecore/content/Demo Site 1/Home" />
 <exclude childrenOfPath="/sitecore/content/Demo Site 1">
 <except name="Forms" includeChildren="false"/>
 <except name="Components" includeChildren="false"/>
 </exclude>
 <exclude childrenOfPath="/sitecore/content/Demo Site 1/Components/Banners" />
 <exclude childrenOfPath="/sitecore/content/Demo Site 1/Components/Promos" />
 <include name="DynamicSitesMediaFolders" database="master" path="/sitecore/media library/DynamicSites" includeChildren="true">
 <exclude childrenOfPath="/sitecore/media library/DynamicSites/Demo Site 1/Images"/>
 <exclude childrenOfPath="/sitecore/media library/DynamicSites/Demo Site 1/Files"/>
 </include>
</predicate>
<!--exclude the dynamic sites fields that will be different for each environment-->
<fieldFilter type="Rainbow.Filtering.ConfigurationFieldFilter, Rainbow">
 <exclude fieldID="{2E6EA147-39B4-48B9-B729-89DB73646518}" note="'Hostname'" key="Hostname" />
 <exclude fieldID="{671F0A96-8270-49C6-B25C-17A4A4EE5730}" note="'Port'" key="Port" />
 <exclude fieldID="{A9B6C54F-88CB-4A9F-9250-6B2B1D26B79C}" note="'Properties'" key="Properties" />
 <exclude fieldID="{E6869EFC-46EB-458E-9990-3DBF914E6F85}" note="'Database'" key="Database" />
</fieldFilter>
<dataProviderConfiguration enableTransparentSync="false" />
<syncConfiguration updateLinkDatabase="true" updateSearchIndex="true" />
</configuration>

Note the use fieldFilter usage here to exclude deployment of the environment specific fields such as the Hostname.

Caching

The caching for the Dynamic Sites module has been implemented using a custom Sitecore cache and therefore shows up in the Sitecore Cache.aspx page viewer. If you want to explore what is in the cache to debug any issues with Caching then you might want to use an tool to do so. I used this Cache Viewer SPE Module and it worked really well for seeing the cache for each Site. The cache key used is DynamicSites.SiteCache.

dynamic-cacheviewer

You should find that if you clear the cache then any settings you update should update and be reflected.

Default Context Database Issue

We had some issues serving some Dynamic Sites from the CD Server. The error we were seeing was:

ERROR An error while Initializing occurred
Exception: System.InvalidOperationException
Message: Could not find configuration node: databases/database[@id='master']
Source: Sitecore.Kernel
 at Sitecore.Configuration.DefaultFactory.GetConfigNode(String xpath, Boolean assert)
 at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert)
 at Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert)
 at Sitecore.Configuration.DefaultFactory.GetDatabase(String name)
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteSettings.get_GetCurrentDatabase()
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteSettings.get_GetSettingsItem()
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteSettings.get_SitesFolder()
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteManager.GetDynamicSitesDictionary(Site defaultSite)
 at Sitecore.SharedSource.DynamicSites.Sites.DynamicSitesProvider.InitializeSites()
 at Sitecore.SharedSource.DynamicSites.Sites.DynamicSitesProvider.GetSites()

After some further digging into the DynamicSiteSettings class It turned out that for some reason the module was not finding the context database and so was falling back to Master in this block of code:

public static Database GetCurrentDatabase
 {
 get
 {
 return Context.ContentDatabase ?? Context.Database ?? Database.GetDatabase("master");
 }
 }

Our CD servers do not have access to the Master database so thats why the error only occurred on CD. To resolve this I branched the module and added a setting for the database fall-back instead of a hard coded ‘master’ value. This is set like so in the config:

<!-- Dynamic Sites - Fallback Current Database
 The database to fallback to when getting the current database 
 if Context.ContentDatabase & Context.Database are null
 -->
 <setting name="DynamicSites.FallbackCurrentDatabase" value="master" />

On our CD servers we set this to Pub where our published live content exists and this resolved the issue. This issue doesn’t seem to occur on an out of the box install of 8.2 u7 or 9.0 so It may be a nuance of our specific setup but if you come across if feel free to use my patched version.

Conclusion

We’ve only launched two Sites using the Dynamic Sites Manager Module so far but it’s working really well. Obviously you don’t get a bunch of pre-built components and some of the other Bells and Whistles you get with SXA but if you need  flexible, simple, well implemented, and full-featured Microsite/Dynamic Site solution which allows you to use your existing page templates and components then I can highly recommend it.

Thanks again to Pete for his hard work on this and his assistance. I’ll try not to ask him any more questions…

Sitecore Horizon Features & Functionality – SUG Presentation

Back in March before everything changed in the World and the UK ground to a halt with the Coronavirus pandemic, we managed to squeeze in the first Manchester Sitecore user group of the year.

Horizon

I presented an overview of Sitecore Horizon Features & Functionality in Sitecore 9.3. I talked about what Horizon can do as well as some of it’s current limitations, how to install it and demoed editing an custom page I’d built in Sitecore MVC in Horizon.

My talk seemed generally well received and there was quite a lot of discussion about various aspects of Horizon, some of which I’ve edited out to keep the presentation a reasonable length. One of the hot topics was around how existing MVC pages would work with it and surprisingly they mostly do (for field types that are supported at this point anyway).

I think it was useful for others who haven’t yet installed Horizon to have a chance to see it in action and to think about how it might be used in the future for Sitecore Page Editing.

On The Horizon

It’s taken a while to adjust to the ‘New Normal’ with Covid-19, so this post is much delayed. However this week I finally got round to editing the video of my presentation and publishing it on my YouTube Channel, so here it is:

I hope it’s useful for others too and thanks to Jeremy Davis and Dominic Hurst for their help organising the SUG and to Valtech for hosting.

It may be some time until we can have another one in person but i’m starting to think about planning the next Manchester SUG (online only – in June/July) so if your interested in speaking at that one then let me know.

Stay safe eveyone.

New UK Sitecore User Group Website

TLDR

If you are looking for Manchester Sitecore User Group or London Sitecore User Group events please visit: https://scug.co.uk/

Why we are no longer using Meetup.com

Meetup recently announced a change to their pricing policy for organising meetups and now want to charge each attendee $2 to RSVP for an event.

Given that it’s unlikely that everyone will want to pay this to RSVP to SUGs a New UK Sitecore User Group Website has been created by Steve McGill and Johannes Zijlstra. We are no longer using Meetup.com anymore to advertising UK SUGs.

The Manchester, London, Bristol and Cardiff Sitecore User Groups will all be using https://scug.co.uk/ to advertise SUGs going forwards.

Sitecore User Group UK

 

suguk-login

 

 

 

 

 

 

 

You can register for an event by clicking the Login link at the top of the page and login with either: Google, Facebook, GitHub, Microsoft, Twitter or LinkedIn.

You can do so safely, we will not share your email address with anyone, including sponsors.

As the Site is fairly new I thought I’d write this post to try and raise awareness of it and encourage people to Signup for the upcoming London and Manchester Sitecore User Group events.

Upcoming Sitecore User Groups

The following is a list of up-coming UK Sitecore User Groups:

> London Sitecore User Group

26th February 2020 @Avanade, 30 Cannon Street

https://scug.co.uk/events/2020/02/london-avanade-sitecore-usergroup/

> Manchester Sitecore User Group

11th of March 2020 @Valtech’s Offices, Basil Chambers, 65 High Street, M4 1FS

https://scug.co.uk/events/2020/03/manchester-sitecore-usergroup/

Hopefully this is useful for those not aware of this change and we’l see you at one of the UK SUGs soon.

Thanks to Steve and Johannes for their time to building and updating the Site too!. I’m trying to help with some new features and if you fancy helping out too then. I’m sure they would be happy for your to input.

Installing Sitecore 9.3 And Horizon

TLDR

Installing Sitecore Horizon involves first installing Sitecore 9.3 and then Installing Horizon as a separate module from here. Follow the Sitecore Horizon install instructions below.

Sitecore 9.3 dropped yesterday and It ships with a number of updates to JSS, SXA, Sitecore MVC and Sitecore Forms and more. However the Mostly Highly anticipated part of this release is Horizon – Sitecore’s all new Page Editing interface (yes ‘Page Editor’ is back – but this time built with Node and much faster). Horizon also has Simulator Mode and Insights View which look pretty cool.

horrizon-editing

For those of you keen to take a look at Horizon in more detail this blog post is going to give you an overview of how to install Sitecore 9.3 and Install Sitecore Horizon on a local development environment.

Sitecore 9.3 Install

In 9.2 Sitecore released a new simple installer called SIA (Sitecore Installer Assistant) and that is what we are going to use to install Sitecore 9.3. You can also install Sitecore via SIF and ARM Templates but were going for the quickest and simplest option in this post.

SIA will also install all of the elements now required to run an Sitecore instance for you such as Solr, Identity Server and xConnect. It doesn’t however install Horizon for you so we’l also cover that later on in this post.

Step 1 – Download The Installer

You want the ‘Graphical setup package for XP Single’ package from this page:
https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/93/Sitecore_Experience_Platform_93_Initial_Release.aspx.

Download the zip file, unblock it and extract it.

Step 2 – SIA Pre-Requisites

To use SIA (or install Sitecore 9.3 in any way) you will need to have the following in place:

  • IIS 10
  • .NET Framework 4.7.2
  • .NET Core 2.1.12 Windows Hosting Module
  • SQL Server 2016 SP2 and 2017
  • Microsoft PowerShell® version 5.1 or later
  • An Valid Sitecore Licence for 9.3

Step 3 – SIA Install Process

Run the Setup.exe file from the extracted folder and click ‘Start’.

sia-start

There are a number of great blog posts out there that cover using SIA in detail – such as Robbert Hocks excellent guide, so I’m not going to go through all the installer steps in detail, However I will summarise them here and provide some tips.

  1. Pre-requisites – SIA uses SIF under the hood and requires version 2.2 of SIF.
    It will try and install it for you but If you have issues with the installer failing at this step you may wish to check which version(s) of SIF you currently have installed:

    Get-InstalledModule -Name SitecoreInstallFramework -AllVersions

    You might need to uninstall old versions before trying SIA again. More info on this here: https://www.koenheye.be/multiple-versions-of-the-sitecore-install-framework/

  2. Install Solr – Solr is now required as part of the install. If you already have an instance of Solr running on port 8983 then choose a different port for your 9.3 install. I would suggest something like ‘sc93-‘ as the prefix as SIA installs Solr 8.1.1 for you and when it creates the windows service and folder it appends ‘solr-8.1.1’ to the prefix you enter like so: ‘sc93-solr-8.1.1’.
  3. Sitecore Settings – SIA will append ‘sc.dev.local’ to whatever you add as the instance prefix so ’93’ would make sense here. It will also use this prefix to name the XConnect and Identity Server sites too:93-sites

 

 

I bet most people will still us ‘admin/b’ as the username and password too :-).

sc-9.3-install-complete

Once you’ve completed the other steps in the installer it will validate the install and should complete the installation in around 10-15 minutes. If you have any issues then check the logs in SIA. If all went well you should be able to open your site by clicking the button on the final SIA screen or going to it in your browser, e.g: https://93sc.dev.local/.

Sitecore Horizon Install

You may have noticed during the install that SXA was an optional module you could install from SIA, unfortunately Horizon isn’t, hopefully it will be in future releases. Therefore we need to install Horizon separately. I hit a few stumbling blocks with the install which I’ll cover at the end.

Step 1 – Download The Install Files

You want the ‘Sitecore Horizon for On Premises deployment’ package from this page: https://dev.sitecore.net/Downloads/Sitecore_Horizon/93/Sitecore_Horizon_93_Initial_version.aspx

Download the zip file, unblock it and extract it.

Step 2 – Sitecore Horizon Install Pre-Requisites

Before you begin the install ensure you have the following in place:

  • You’ve installed Sitecore with HTTPS, SIF 2.2.0 & Sitecore Identity is installed (you will have done if you’ve used SIA ‘as is’)
  • Web socket protocol is installed, you can enable this under ‘turn windows features on and off’.
    web-socket-protocol

 

 

 

 

 

More info here: https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support

dotnet --info

dot-net-runtime

  • You have Node 10 and npm 6 installed. If you don’t have Node installed at all then use this download package for Windows: https://nodejs.org/dist/v10.0.0/node-v10.0.0-x86.msi.
    I prefer to use NVM myself to install and manage node versions but I could not get Horizon to start for some reason despite having node registered correctly on my Path variable in Windows.
  • Your Sitecore licence must also include Horizon or you won’t be able to run it.

Step 3 – Sitecore Horizon Install Process

Open up the parameters.ps1 file from the extracted folder and set values for the following parameters:

  • $ContentManagementInstanceName – this should be the name of the Sitecore instance you just created in IIS via SIA – e.g “93sc.dev.local”.
  • $ContentManagementWebProtocol – this should always be “https”
  • $SitecoreIdentityServerPhysicalPath – this should  be the path to the Sitecore Identify instance you just created in IIS via SIA – e.g: “C:\inetpub\wwwroot\93identityserver.dev.local”
  • $SitecoreIdentityServerPoolName – this should be the name of the Sitecore Identify instance app pool  – e.g: “93identityserver.dev.local”
  • $SitecoreIdentityServerSiteName – this should be the name of the Sitecore Identify instance – e.g: “93identityserver.dev.local”
  • $LicensePath – this should be the path to where your licence file can be found – e.g: “C:\inetpub\wwwroot\93sc.dev.local\App_Data\license.xml” – This one is important to get right to avoid some of the errors I hit with the license ending up in the wrong folder (see Troubleshooting section), the official installation PDF isn’t clear about this but it is the FULL PATH including the FILENAME.
  • $authoringHostName – this will be the url that Horizon will run on, the install file tries to set this for you based on the name of your Sitecore instance etc but you can set this if you wish, I set this to: “horizon.93sc.dev.local”. – Others have mentioned to me that when they didn’t set this they had issues. Also make sure you name the Host Name using the same domain as the Sitecore Content Management instance, so that the format is like so: {something}.{cmsinstancename} as above.  as in the official install PDF Guide it mentions a change regarding how cookies work in Chrome which will break this if you don’t follow this format.

params

 

 

 

 

 

 

 

 

 

Now open up the Install.ps1 file and run it (make sure you are running it as an Administrator).

horizon-install1

 

 

 

 

 

 

 

 

 

 

 

 

Wait a few minutes and the install process should complete:

horizon-install2

 

 

 

 

 

 

 

 

 

 

 

 

Once it has completed you can either go to your horizon instance in your browser, e.g “horizon.93sc.dev.local” or you can re-start and open up your Sitecore 9.3 instance and click on the swanky new Horizon Icon that you should see on your Launchpad:

horizon-icon

 

 

 

 

 

All being well Horizon should load and you should see the following screen:

horrizon-complete

Sitecore Horizon Install Troubleshooting

One of the main reasons I wrote this guide is I had a few issues with the install. I’m going to outline them below and the fixes required.

Debugging Horizon

First some tips on Debugging Horizon as I couldn’t find much out there on this.

    • Run the Authoring.Host.dll directly from the root folder (e.g: C:\inetpub\wwwroot\horizon.93sc.dev.local) like so to give you direct output on the errors in the console:

dotnet Authoring.Host.dll

run-host

    • Check the logs in your Horizon app (e.g: C:\inetpub\wwwroot\horizon.93sc.dev.local). By default I think they just write to the root folder. You will see two different logs: ‘AuthoringHost’ and ‘stdout’ logs. If you are not seeing any logs then edit the web.config file at the root of the Horizon app and check stdoutLogEnabled is true, you can also change the path for the log files here.

stdoutLogEnabled=”true” stdoutLogFile=”C:\inetpub\wwwroot\horizon.93sc.dev.local\logs\stdout” />

Errors & Issues

Here are some issues I had which I had to resolve.

HTTP Error 502 – Process Failure

This error basically just means that dotnet core could not run the app. It’s a pretty generic error message which can mean a number of things so you need to dig into the logs to find out more info.

horizon-error

I didn’t have an issue with my .net versions but one key thing to check first is that you have the right versions of the .net core runtime installed.

Licence Error

Looking in the logs for more info this is the first error I was getting:

Unhandled Exception: System.InvalidOperationException: License file doesn’t exist on disk.
at Sitecore.Framework.Runtime.Commands.SitecoreHostCommand.LoadLicenseXml(String filePath, String contentRootPath)
at Sitecore.Framework.Runtime.Commands.SitecoreHostCommand.OnExecuteAsync(CommandLineApplication app)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments) in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 77

To resolve this I needed to copy the licence folder into the /sitecoreruntime folder e.g: c:\inetpub\wwwroot\horizonsc93sc.dev.local\sitecoreruntime.
I’m not sure if this is a bug but the installer seemed to put the licence file in the wrong location (/config).
Thanks to Vlad for his help with this: https://sitecore.stackexchange.com/questions/23209/running-horizon-failed-http-error-502-5-process-failure.

Patch File Error

This was the 2nd error I was seeing:

Unhandled Exception: Sitecore.Framework.Configuration.Patcher.ConfigurationException: An error occurred during applying the patch file: C:\inetpub\wwwroot\horizon.93sc.dev.local\Config\license.xml —> System.Exception: Could not merge node ‘signedlicense’ in patch file ‘license.xml’
at Sitecore.Framework.Configuration.Patcher.XmlPatcher.ShouldPatchNode(XmlNode target, IXmlElement patch)
at Sitecore.Framework.Configuration.Patcher.XmlPatcher.Merge(XmlNode target, IXmlElement patch)
at Sitecore.Framework.Configuration.Patcher.XmlPatcher.ApplyPatch(String filename, XmlNode node)
at Sitecore.Framework.Configuration.Patcher.ConfigReader.LoadIncludeFiles(IEnumerable`1 files, XmlNode node)

To resolve this error I had to remove the licence that was not needed from /config (e.g: C:\inetpub\wwwroot\horizon.93sc.dev.local\Config ) as this was confusing Horizon.

Failed to render a page

I was seeing this error. This means that Horizon is running now but there is an failure in rendering the application.

horizon-load-error

NodeJs Error

Looking in the logs for more info this is the 3rd error I was seeing:

System.InvalidOperationException: Failed to start Node process. To resolve this:.

[1] Ensure that Node.js is installed and can be found in one of the PATH directories.
Current PATH enviroment variable is: C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files\azcopy;C:\Program Files\Git\cmd;C:\Program Files (x86)\dotnet\;C:\Users\Adam Seabridge\AppData\Roaming\nvm;C:\Program Files\nodejs;…
Make sure the Node executable is in one of those directories, or update your PATH.

I had this issue for two reasons:

1) I was trying to use NVM to manage my node versions and it would not find my node version even though node was registered correctly on my path. I couldn’t resolve this so ended up installing Node using the Windows installer instead of NVM.
2) I needed to restart IIS after I’d installed node. I would recommend a reboot of your machine after you install Node.

 

That all folks. Hopefully others who are keen to see Horizon in action will find this useful.
Feel free to comment or tweet me with any suggestions on any of the installation process or things I’ve missed.

You can find the docs on Horizon here. Enjoy.