codeflood logo

Coffee => Coder => Code

Ramblings on code, Sitecore and stuff

WeBlog 3.1 Released

After much more development effort than we originally anticipated, I'm very happy to announce WeBlog 3.1 has been released!

Sitecore 8.2: Mock your Items

Back in January I wrote an article about how to Roll your own Sitecore Item, which showed how to create an in-memory Sitecore item for use in testing. The technique was quite limited and still required some small config entry to allow everything to work (to create a Database instance). Well, Sitecore 8.2 has finally made a reality what so many of us have prayed for, for so long. We can finally mock Items and Databases with Sitecore 8.2. Though, it's probably not quite as simple as you might hope.

Sitecore Integration Testing Made Easy

A few years back, I uploaded a couple of short videos to YouTube to show how easy it can be to get started with testing your Sitecore solution. The approach shown in the videos uses my ASP.NET embedded test runner. I developed the first version of this test runner when I was first trying to test my own Sitecore projects, many years ago. The issue many developers face when trying to test their Sitecore solutions is trying to get the Sitecore code to run outside of a web/Sitecore context. What I managed to do with this test runner was flip the problem on it's head; instead of trying to get the Sitecore code to work inside my unit test, I made my unit test work inside my Sitecore solution.

Trekroner Fort

If there were a Mecca for Sitecore developers, it would likely be this place. Trekroner Fort. This famous Danish landmark welcomed many fresh-faced Sitecore developers and users as the default desktop background in Sitecore version 7.x and prior.

Roll your own Sitecore Item

One of the most difficult aspects of unit testing against Sitecore is mocking Sitecore items. The Sitecore Item class is quite a complex class and it's interface is not structured the way most mocking frameworks require. Mocking frameworks allow you to create dummy objects for use inside tests. But that's not the only way to create dummy objects. One can always instantiate a class if the classes interface allows it. You might be surprised to learn that you can in fact create an instance of a Sitecore Item in your own code.

Revolver 3.0 Released and Open Source

Well, it took 3 years and help from 2 other contributors, but Revolver is finally open source! You'll find the module source on github at https://github.com/codeflood/revolver. Revolver has been release under the MIT license. Revolver 3 supports Sitecore versions 6.4 through to 8.1 and you'll find the release packages either on github...

WeBlog 2.4 Released

After a hell of a lot of effort I'm very proud to announce the release of WeBlog 2.4. The biggest feature of this release is full support for Content Search and support for Sitecore 8.0. You'll find a full list of issues fixed on the release page above. This release also marks the end of support for any version of Sitecore prior to 7.0. The codebase still contains all the old code and build...

Testable Code

Ahhh, automated testing. It's what gives you that warm fuzzy feeling that your code is all working as you intended. A validation that you're free from errors and a safety net for future modifications. OK, perhaps not necessarily free from errors, but you at least know the cases you've got covered are correct, and they're easy to run at any time to validate those cases are still working as...

What to Test?

Recently I was having a discussion with someone around how to test certain scenarios in Sitecore. The scenario in question involved testing a sublayout on a page to ensure it was working properly, and the developer was thinking of using something like Selenium to do this. This raised a flag with me. Although there are scenarios in which an automated web tester is the correct approach for this...

Reusable JavaScript in SPEAK

In my previous post I showed how to extend existing SPEAK models and views when creating new SPEAK components so we can reuse what we've already got rather than duplicating wads of code. Reuse at the view and model level is good but it's only one part of the puzzle. What about reusing individual functions? To reuse arbitrary code in C# we can wrap that code up in a class which can be called by other code files by way of a using statement (and appropriate references in the project). But JavaScript doesn't really have a native way to allow including existing functions from another location in the current file. It's normally up to the host environment how to get other files loaded in before the current file.

Reusable SPEAK components

With the recent(ish) release of Sitecore 7.2 the greater Sitecore development community is finally getting their hands all over the shiny new SPEAK UI framework. SPEAK is a successor to Sheer UI and is intended to be used by all developers wanting to add functionality to a Sitecore instance. I've written this post against SPEAK 1.1 which is included in Sitecore 7.2. One of the strong design...

Revolver 2.2.2 Released

Two (and a half) weeks and two releases! This minor update for Revolver includes fixes to support shared session state. Shared session state occurs when an ASP.NET application is configured to store session state outside the memory of the ASP.NET application itself, or in other words, when InProc session mode is not used. With shared session state the objects stored in session need to be...

Revolver 2.2.1 Released

Revolver 2.2.1 has just been released and is now available over at codeflood. This is a rather small release to address 2 specific issues. You will find the downloads for the Sitecore package on the Revolver Download Page. The first issue addressed was a security concern in the Javascript of the Revolver client. Thanks goes to Marcin Okon of bwin.party who raised the concern and helped verify the...

Unique Item Name per Bucket

Last year I wrote a post on customising the URLs used to access items within an Item Bucket when using Sitecore 7+. The basic idea was that the structure of the bucket was completely ignored. So a URL for an item within a bucket would include the path to the bucket, then the item name. There was one important aspect of this approach that I deliberately ignored at the time of writing to keep the...

Revolver 2.2 Released

Merry Christmas Sitecore devs! And what better way to say Merry Christmas than by releasing a new version of Revolver for the Sitecore community. That's right, Revolver 2.2 is now available for download from the Revolver Download Page . Revolver 2.2 brings a variety of new commands for your scripting pleasure.

HTML Cache Lifetime

Any high performance Sitecore website will make good use of caching. After all, pulling already computed values from memory is much quicker than recomputing not to mention the required network trip to the DB to get the data to compute with. When it comes to individual presentation component caching, there are several options to allow varying the cached output on a number of aspects. For example,...

WeBlog 2.3 Released

WeBlog 2.3 has been released! You can grab the Sitecore packages from the WeBlog page on the Marketplace or grab the source from github.

Setting incompatible properties from parameters

Sitecore enables us to create reusable presentation components by allowing us to pass parameters to our component when it's used. Rather than hard coding everything required by the components, or reading it from some predefined location in the content tree, we can instead set the parameters of the component when it's placed on the page either through the presentation dialog or in the page...

Item Buckets and URLs

Update: Please also read http://blog.horizontalintegration.com/2013/07/30/sitecore-contentsearch-fails-for-lucene-reserved-keywords-like-andor/ to solve issues if you have common stopwords in your item names such as "and" and "or". So it seems everyone is having fun with Item Buckets in Sitecore 7. No seriously, go take a look at the social channels. Item Buckets open a realm...

Revolver 2.1 Released

Today I'm happy to announce the release of Revolver 2.1. You can head on over to the codeflood website to get the Sitecore package files right now. These will also be available on the Sitecore Marketplace very soon. This isn't a huge release, but does have some important new features. Let's take a look at each of these.