Sitecore Client Logging with JSNLog In Sitecore 8.1

With Sitecore 8.1, support has been added to log client side events. The new logging framework is built upon the standard Sitecore logging framework (which uses Log4net), allowing client side events to be logged back to the data/log folder on the delivery server. Continue reading

Sitecore Razor / Glass Attribute Helper Methods Fluent API

After blogging about creating some Sitecore Glass Attribute Helper Methods (Blog Post) to help front end developers add HTML attributes to Razor / Sitecore Glass Mapper controls. I had an interesting comment from Jim Noellsch, mentioning about turning the helper classes into a Fluent API.

With a Fluent API, A developer is able to chain up multiple method calls, by returning the object on each method. See an example here for a better explanation than I can give http://www.codeproject.com/Articles/640997/Fluent-interfaces-and-Method-Chaining-in-Csharp.

Continue reading

Sitecore MVC Custom ID Model Binder

In this post i’ll explain how to create a custom Model binder in ASP.net to allow you to pass in a Sitecore ID in your controller action.

For example the controller action below accepts a Sitecore ID, however .net doesn’t know how to create the ID class from the form values passed to the action. Continue reading

Sitecore Glass Attribute Helper Methods 

When using Sitecore Glass’s helpers to render content in a experience editor compatible way, it is possible to add a NameValue collection to specify attributes to be appended to the HTML element. http://stackoverflow.com/questions/19587981/how-to-render-link-with-css-class-with-sitecore-glass-mapper Continue reading