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 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