Custom Sitecore DataViews

  • 16 Jul 15

If you have ever used Sitecore buckets you have probably wondered how it hides items in buckets from the Content Tree. In this blog post I will show you how you can make a similar feature in your solution.

Read More

V4 All The Things

V4 Released

  • 01 May 15

Today is a very big day in the history of Glass.Mapper.Sc with the release of V4! This is the biggest change to Glass.Mapper.Sc in the last 2 years and sees many great new features being added to the framework:

Read More

Glass.Mapper.Sc V4 Coming Soon!

  • 24 Apr 15

Glass.Mapper.Sc V3 has been around for nearly 2 years now and we have had over 26,000 downloads from Nuget which is amazing! We are now looking forward to the future and we wanted to give you an overview of the major changes that will come in V4. The new features were demonstrated at the Sitecore Users Virtual Group which you can watch below, more details about each feature can also be found further down the page.

Read More

Getting child items

  • 13 Apr 15

Glass.Mapper.Sc offers many different ways to get children and ways to filter those children, in this blog post we explore a few of these solutions.

Read More

Image Parameters In Glass.Mapper.Sc

  • 25 Mar 15

@RenderImage(x=>x.Image)

The html that is rendered will be:
<img src="/~/media/Images/38175_442041638932_1646261_n.ashx?h=225&w=300">

If however the developer decides to define a w parameter (see Sitecore Image Parameters) Glass will ignore the settings set by the content editor, e.g.:

Read More

Getting Sitecore Ancestors

  • 16 Mar 15

We have several options when it comes to finding the ancestors of the current item:

Read More

Template Models vs Rendering Models

  • 01 Jan 15

public partial interface IPageTitles : IGlassBase { bool DisplayInMenu {get; set;} bool Dropdown {get; set;} string Icon {get; set;} string LongTitle {get; set;} string ShortTitle {get; set;} string StrapLine {get; set;} } This makes it very easy to find the model you want to use because you just have to look at the name of the template and then find the matching class.

One issue to overcome is the multiple inheritance of templates. This is easily solved by making use of interfaces as we have done above. A model of a sub-template can easily inherit the interfaces of the super-templates. For example if I have a content page that inherits my IPageTitles template and a IMetadata template then my Content interface can inherit both:

public interfacet Content : IPageTitles, IMetadata{
}

Template Models are easy for new developers to understand and it is easy to trace where the data is coming from however it does have certain limitations:

Read More

Web Activator Removal

  • 07 Dec 14

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <initialize> <processor type="Glass.Website.App_Start.GlassMapperSc, Glass.Website" /> </initialize> </pipelines> </sitecore> </configuration>


Read More

Sitecore Summit 2014

  • 21 Nov 14

If you missed our presentation or you want to see it again you can find it below. We managed to install Sitecore, setup a Visual Studio project, install Glass and render data to screen in just over 5 minutes. For some reason I also think it is the year 2015:

Read More

Testing Pipelines

  • 13 Nov 14

Last week we had an MVP meetup in London for the UK MVP's where we discussed how we normally test our Sitecore solutions. We discussed several different methods of unit testing and integration testing. The last task was to take an existing piece of pipeline code and try to create some tests for it.

This pipeline task was a 404 handler in the HttpBeginRequest pipeline. These aren't normally easy classes to test because they have a parameterless constructor which means we can't use DI and they also work heavily with services that can't be mocked, e.g. Sitecore Database and the HttpContext.

Read More