How we work day to day affects our ability and other peoples ability to learn and solve problems.
I have had many questions about using Glass with Sitecore SXA. In this two part blog post I will explore the limitations and possibility of integrating Glass with Sitecore SXA.
I take a look at the new Cache Always On feature and what you need to know when using it.
Cache Always On allows you to improve the performance of your sites by caching all your models. Find out more about this feature that is coming in the next release.
It is the end of 2018 and it has been a great year for the Glass.Mapper.Sc project.
Today I have released Glass.Mapper.Sc support for Sitecore 9.1 (Release notes)!
In my last blog post I discussed how I had moved to a paid for training course to help fund and support the Glass.Mapper.Sc project. I also discussed different ways that the project could be supported, ( e.g. donations, sponsorship, etc) and requested feedback from the community.
Recently there have been a few discussions about the removal of documentation and the changes to a paid training course. In this blog post I want to address those comments and the reasons for the changes.
In this blog post I am going to look you can work with Glass.Mapper.Sc in a Helix styled solution, specifically I will look at how to load configuration in a Helix solution
In has taken a lot of hard work and several months to complete Version 5 of Glass.Mapper.Sc but finally last night I was able to push the release to Nuget.org!
A problem that often occurs on Sitecore solutions is the accidental large publish. A user mistakenly selects a top level Sitecore item, checks Sub-items and Related Items and then clicks publish.
Kam had written an interesting blog post on how to Precompiled view support has been added to Sitecore 8.2 (http://kamsar.net/index.php/2016/09/Precompiled-Views-with-Sitecore-8-2/) I wanted to implement this on 8.1 U3.
This blog post gives you early information on Release 4.3 of Glass.Mapper.Sc! Check out the new features and let us know what you think.
The latest release 4.2.0.184 of Glass.Mapper.Sc is designed to make it easier for developers to customise and also contribute to the project.
A quick browse through the Sitecore config finds the following publish events:
You may notice that by default Sitecore does most of it's events processing in the publish:end event. However there are a few problems with the publish:end event, firstly it isn't called for every language that is published and it isn't possible to easily get a list of all the languages that were published.
Yesterday on Slack the question of how to handle fields that contain a space came up on Slack. In this post we will look at the different ways we can handle this scenario.
.NET introduced the ability to create extension methods on existing classes. This feature allows us to easily add our own methods to exist classes without the need to create a sub-type.
Language Fallback has always been a little tricky when using Glass.Mapper.Sc because it was necessary to use the VersionCountDisabler class. This was required because Glass.Mapper checks the number of version of an item in the requested language and returns null if there are no versions. The VersionCountDisabled stops this check from happening and returns a model using the empty Item that Sitecore returns allowing you to map shared fields to the model.
Much has been said about upgrading Sitecore solutions with the two main approaches being:
We have released today the new Glass logo which comes in 4 exciting colours:
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.
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:
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.
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.
@RenderImage(x=>x.Image)
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.:
We have several options when it comes to finding the ancestors of the current item:
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:
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:
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.
I have been working on Glass.Mapper for the last 4 years and have seen it grow in strength and popularity within the Sitecore community to become one of the most popular modules. According to Nuget.org there have been over 12,000 downloads of Glass.Mapper.Sc and 500 of Glass.Mapper.Umb, I am not sure how many I account for, but this is an amazing number! I remember that when I originally posted the project I would watch it each week as it slowly crept up, and I was so proud when we reached the first 100 downloads.
Following my last blog post about Glass.Mapper.Sc and Sitecore MVC I have reorganised the Glass.Mapper.Sc assembly to create a MVC specific assembly.
Sitecore is now keeping pace with the .NET MVC versions being released. This is great because if you are building on the latest version of Sitecore you get to play with all the MVC5 goodness. However this has created a problem for Glass.Mapper.Sc.
There will be times where you want to enable the Page Editor for a property on your model but the model itself may not have been mapped by Glass.Mapper.
I recently had some feedback that it would be really good if Glass.Mapper.Sc supported MVVM and still allowed the Page Editor, in this blog post we see how this can be done.
Glass.Mapper.Sc in the next release 3.1.5 you will be able to get items through the SitecoreService and SitecoreContext. Lets see how we can use this.
In this blog post I look at how other Sitecore ORMs can be integrated with Glass.Mapper so that you can request items that work with these frameworks via Glass.Mapper.
The latest release made some subtle but important changes to how attribute configuration is handled by Glass.Mapper. In the latest release we have simplified the process a lot so that you can write even less code.
I recent question on StackOverflow was how to HTML Encode characters with Glass.Mapper.
The great guys at Hedgehog Development (of which I am now one) are holding the Sitecore Users Virtual Summit on the 15th October! Join me as I look at some of the more advanced features of Glass.Mapper.Sc.
In the next release of Glass.Mapper.Sc we will support mapping rendering parameters to object, in this post I will explain how we implemented this.
I had a question yesterday about how to get a different IOC container to create objects that are used by Glass.Mapper rather than the default inbuilt Glass.Mapper method or using Castle Windsor. In this post I will show how this can be achieved and how simple the process is.
I got asked via the other day how to copy images in the Sitecore Media Library using Glass.Mapper.
Umbraco is now the latest CMS supported by Glass.Mapper.
A video demoing a feature in development to allow Glass.Mapper integration with the new Sitecore 7 search api.
Thanks you to all those who attended the Sitecore Virtual User Group presented by Mike Edwards
Mike Edwards will be presenting some of the new features of Glass V3 at the Sitecore User Virtual Group
With the launch of Glass V3 we have introduced a build server. This will allow you to download the latest Glass versions before they are made available on Nuget.org.
Last week I showed you how you could reduce the amount of code you would need to write with Auto-Mapping, however what if you want to write event less configuration? How about not having to write any?
One of the exciting new features of Glass V3 is the ability to auto map properties.