Ben's Adventures in Code

Posts


Rules Engine and Rendering Variants

Published at June 3, 2019 ·  4 min read

The other day I was watching a presentation and learned something new. Out of the box, you can control insert options using the rules engine. Along that line of thinking, I decided to see if I could use the rules engine to customize what rendering variants show up on a component. With some customizations, I was able to use the rules engine to add/remove available rendering variants. However, there is one caveat: Sitecore caches the rendering variants using a cache key made up of the current page ID and the rendering item (in /sitecore/layouts) ID....

Configuring SolrCloud for XConnect

Published at December 13, 2018 ·  3 min read

Sitecore had a documentation page on their old doc site which detailed out how to setup Solr cloud for xConnect. That page has since been taken down and doesn’t appear to have been migrated to the new doc site. Luckily, I was able to find it cached. This blog post contains information taken from that cached page, mixed in with some of my own experiences. Getting Started You should already have Solr Cloud and Zookeeper setup and running with SSL....

Token Replacement on Sitecore Experience Forms

Published at August 10, 2018 ·  3 min read

Sitecore Experience Forms are new to Sitecore 9. This module is a built-from-the-ground-up replacement for the old Web Forms for Marketers and it’s pretty powerful. One of its features is multi-page forms. Multi-page forms means you can segment your form via next and previous buttons. One thing that isn’t really clear is how to pass data from one page to another. I wanted to figure out how to pass data across pages....

Announcing Leprechaun

Published at May 28, 2018 ·  4 min read

Leprechaun I am very pleased to announce, albeit a bit late, the launch of Leprechaun! Leprechaun actually made its debut in April at SUGCON EU, but I didn’t write anything up on its release. I am really passionate about this project and I’d love to share it with you now! What is Leprechaun? Leprechaun is a universal code generator for Sitecore templates that reads in serialized yaml from Rainbow for use in Unicorn-based projects....

ShowConfig on Content Delivery

Published at February 21, 2018 ·  2 min read

The Problem Today I was troubleshooting a problem on a content delivery server. I knew the problem was around configs, but I needed to see the combined config to determine what the exact problem was. Normally, I would login to Sitecore and go to /sitecore/admin/showconfig.aspx and I would see a beautiful XML file that shows me the merged config. The problem? The Sitecore back-end is removed on content delivery servers! There’s nowhere for me to login, and there’s now ShowConfig....

Synthesis Solr Support Now Available (Beta)

Published at December 27, 2017 ·  2 min read

Solr Support is Finally Here! History Three years ago, Jeff Darchuk set out with a mission: Add Solr Support to Synthesis. It was nearly finished, but the pull request never made it in. It’s been a requested feature for quite some time, and I’m happy to announce it’s finally here! What’s the Deal? I’m releasing support for Solr in Synthesis 8.2.7. It’s up on NuGet as a new package: Synthesis.Solr. I am planning on leaving it in beta for about a month....

Synthesis: The Road Ahead

Published at November 19, 2017 ·  3 min read

A couple months ago, Kam Figy joined a team of elite superheros known as the “The X Factor.” Wait… actually I think it’s “The X Team”? “X-Files”? I’m not sure. Go ask him. All I know is he’s off to do amazing things that will advance Sitecore in unimaginable ways in some super secret bunker in Cheyenne Mountain. Anyway, alongside that announcement, he mentioned that he was entrusting ownership of two of his most cherished, most famous, and most widely used repositories to me....

Checking for Experience Explorer Context in Sitecore 9

Published at November 3, 2017 ·  1 min read

With the release of Sitecore 9, a underappreciated DLL was removed: Sitecore.ExperienceExplorer.Business.dll. I’ve honestly never paid much attention to that DLL. The one thing I used it for, however, was determining if the current context was Experience Explorer. Synthesis made use of this: public class SitecoreRenderingContext : IRenderingContext { ... public bool IsExperienceExplorer => Sitecore.ExperienceExplorer.Business.Managers.ModuleManager.IsExpViewModeActive; ... } The new way of handling this is via the IsExplorerMode method in the ExplorerContext class....

Creating Custom Server Roles in Sitecore 9

Published at October 26, 2017 ·  2 min read

Sitecore 9 brings about a new feature: Server Roles. This is actually one of the features I was most excited about. What is a Server Role? Sitecore 9 ships with 5 server roles: ContentManagement, ContentDelivery, Processing, Reporting, Standalone. You can read more about what each role is used for from their documentation page. Using these server roles, you can conditionally load sections of configuration based off the server role. Rob Ahnemann wrote a more in-depth blog post that you should check out if you want more information on what you can do with server roles....

Autowiring XConnect Models

Published at October 24, 2017 ·  3 min read

I’ve been playing around with XConnect for the last few weeks and so far I like what I see. While playing around with custom models, I noticed that model schemas need to be manually registered. While not actually a big deal, this is an additional step that can be forgotten. I prefer to eliminate these “forgettable” tasks. I sought to determine a way of automatically wiring in these models. I’m pretty handy with reflection and figured if I could tag these models with an attribute, I could figure something out....