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 Content Editor Tabs In SPEAK

Within the Sitecore Content Editor, the editor section can change context based on the type of Item you are editing. For example when a media folder item is selected, the view allows you to upload media files, a template item allow you to add fields etc. These areas are called editors.

Media Editor
Media Editor

You can define and create your own custom editors within the Content Editor and specify the type of items it is applicable to. Continue reading

Sitecore Service Client ServicesApiController

With Sitecore 7.5 and now Sitecore 8, Sitecore.Services.Client (SSC) was introduced. This has given us a flexible and powerful framework for created Web API based rest services in Sitecore (See my introduction into Entity Service (part of Sitecore.Services.Client)) Continue reading

Sitecore Entity Service SSC – IoC Configuration

Further into my series on Sitecore Entity Service within Sitecore.Services.Client, in this post I’ll be look into setting up an IoC container (Structure Map in this post) for Entity Service. 

In the below example of the Entity Service services controller we have an overloaded constructor creating a concrete instance of our repository. However moving towards a DI approach we want to remove the coupling to the repository and inject the dependency in instead. Continue reading