About Mikael Högberg

[bio] Work at Stendahls. Blog about coding, hobby electronics and stuff

Sitecore and image ALT texts

If you, like me, develop multi-lingual sites and go for unversioned Media Items, you may stumble upon a couple of problems. Usually we think of media items as a replacement of a regular file, i.e. some kind of binary data that is always the same regardless of its context. The most obvious advantage of a media item over a regular file, is that we can track its usage. That’s really hard with a regular file stored in the file system. The second advantage is of course the ability to decorate a media item with meta data, such as image dimensions etc. Many of these values can be considered as shared values, but some times we want alternative content on different languages, such as alternative (ALT) texts on images. Now the dark clouds are looming…
Continue reading

Sitecore 7.1 is out!

I just got back from Sitecore HQ in Copenhagen after a MVP meeting where Tim Ward and Martin Hyldahl held a great presentation about new cool upcoming stuff in Sitecore. I really appreciate the invitation from Sitecore to let us MVP’s participate in the early development process and give input and feedback to all those brilliant ideas!

While on that meeting, I got some pings about the release of Sitecore 7.1. It’s now available for download on SDN. I’ve had a copy of it since the Miami summit, so I’ve had a little time to play around with it.

The key new stuff is of course Sitecore Process Enablement & Accelerator Kit, aka SPEAK. You’ve probably heard the buzz for some time now. At its basics, it’s really about creating backend UI’s and applications in a more convenient and streamlined way. Eventually it’ll replace Shear UI, but don’t consider using it for the front end web. It’s not meant for that, at least not yet. If you’ve installed one of the later versions of ECM, you might have noticed the speak folder in the shell. This is not SPEAK. The real SPEAK UI Framework is released now in Sitecore 7.1.

Along with SPEAK, comes a set of updated UI components in the CMS backend, such as selecting items from the Media Library and inserting links.

The second big news is that Sitecore Rocks is now in version 1.0 (1.0.1 actually) and is a supported product. Rocks is actually required to develop SPEAK applications, but who would ever consider developing such stuff without Rocks anyway? If you’re not working with Rocks already, it’s about time you start.

Sitecore has also done improvements to the Rules Engine. Some as part of the SPEAK implementation but you can leverage this in other areas as well. There is also support for MVC 4 and the Sitecore Item Web API has been improved and is now distributed as part of the product instead as a package.

There are also some minor, but still important, improvements and fixes. We finally got rid of the annoying Guids in the search boxes. It now displays the proper item names and the Guid is exposed when hovering instead. Now we just want inclusive to be the default search operation and not the third option.

New PCB’s recieved

PCB'sGot a set of new PCB’s from OSH Park today. Time for some soldering. This one is a bit more generic, so I can mount different sets of components to gain different functions. Fully mounted it’ll measure three temperatures, pressure, humidity, wind speed and direction, rain, sun light and snow depth. The data will be stored on a microSD card and sent wirelessly. My goal is to run this board for at least six months on two AA-batteries.

Sitecore MVP Summit summary

On my way home from the excellent summit of two full days of inspiration with 64 of the 104 best Sitecore developers in the world were gathered at the James Royal Palm hotel at South Beach, Miami.

Starting up day one with the mandatory keynote by Michael Seifert and Lars Nielsen, we were informed that we MVP’s as a group only make up were the top 0.035% of all Sitecore developers. Nice stats!

John West scratched the surface of SPEAK, Star Wars style. Unfortunately we can’t talk much more about that right now.

After lunch, Nate Barad took us through the Insiders Roadmap. Really cool upcoming stuff ensuring Sitecore will extend it’s visionary lead in the industry. Competitors, watch out!

We then had a 45 minute group challenge. Given different tasks and grouped into seven teams, we had to convince the jury that our solution to our problem was the best one. Tough competition with only MVP’s on site. Our team didn’t came out as overall winners, but were announced the Most Creative Team price during the evening dinner on board the Venetia Lady Yacht.

Second day we dived deep into the Links Database with Alex Shyba who challenged the demo goods with a prototype of… something related to the Links Database, for MVP eyes only.

A great open Q&A session with the whole present Sitecore team, brought up a lot of interesting discussions and clarified some more details of where Sitecore is heading with certain parts of the product.

Anthony Hook had another secret session with the newest and coolest upcoming stuff. I shouldn’t even disclose the subject I guess..

We had a really good non-technical session with Thomas Eldblom about the IT/Marketing Gap, Digital Marketing Governance. Most customers should listen this session!

Adam Najmanowicz showed us a really cool Zen Garden Framework were he’s done amazing things with the Page Editor and a way of managing parallel development. This is probably the way to go forward in order to tighten up the project time schedule.

Lars Nielsen wrapped up the summit with the story of Sitecore from the very beginning.

Unfortunately I missed the welcome party on Wednesday, but we had some time to meet and network between us MVP’s as well. As important as anything else on the summit.

A big Thank You to Pieter Brinkman and Marissi Dresnek for arranging all this, and I’m looking forward to .next years summit!

Sitecore MVP Summit website.

Sitecore MVPs at the beach

Build settings for TDS

Yesterday I spent some time with the nice guys at Hedgehog Development and I remembered a problem that we’ve experienced lately in our team.

The problem we had, is that TDS sometimes doesn’t copy the right files into our web project. Actually, it turned out it didn’t copy the latest versions of the recently built files. This can happen sometimes when using parallel builds, so TDS may start copy the files into the web project before the other builds are completely finished. Change the build options in Tools->Options->Project and Solutions->Build and run and set the maximum number of parallel project builds to 1, so that projects are built once at a time.

Build options

Works perfectly for me! Thank you guys!

Sitecore MVP Summit Challenge – Team 7

Update: At the Sitecore MVP Summit 2013, day 1, we were divided into seven teams and were each given a group challenge. Our team got the question “Present the best way to manage your Sitecore blog”. We had 45 minutes to come up with a presentation, so we decided on writing a blog post about it. Below are the result findings used during the presentation at The James Palm Beach Hotel, Miami, USA. This blog post was tweeted and commented during the presentation.

The presentation also included singing the Sitecore blogging song!

The MVP team members:

Continue reading

Add a proper LastModified field to Sitecore

To track item changes Sitecore uses the “__Updated” field in the Statistics section. It’s a normal Datetime field i.e. it contains a date for every language and version. This is fine in most cases, but sometimes you need to track changes a bit further. For example when you change a shared field, you’re applying a change to all languages and versions. So how do you track those changes?

An image in the Media Library is a typical example of this problem. If you change the image, you’ve changed the item on all languages, but if you just add a translation to the “ALT” text, you’ve only changed that particular version.
Continue reading

A different way of using Sitecore

Developer meeting Gothenburg

Presenting a live demo of the solution

This week I’ve been speaking at the Sitecore developer meeting in Göteborg. My speech was a live demo of a quite different way of using Sitecore.

We at Stendahls have created an event solution where we’ve throwed away PowerPoint and uses a web browser instead for presentation. The audience each have an iPad mini as a second screen and the speakers controls everything from an iPad instead of using a clicker.

Charging iPads

Charging 120 iPads for the event

Everything is driven by Sitecore and SignalR and we had this setup for 120 iPads and about ten presentation screens. It worked extremely well and just imagine what you can do with DMS, ECM, Analytics and personalization when the audience are all logged in as a Sitecore user using a pin code from their badge. 🙂

At the developer meeting we also listened to some nice insights about Sitecore DMS by @SimeonArrr and some code examples in Sitecore 7 by @LarreCMS.

I hope I’ll be doing the same speech at the next Sitecore developer meeting in Malmö.

Sitecore Image Optimizer module

This is going to be a very short one – I’m really too busy right now to spend time on doing a proper blog post. I hope I’ll manage to do an update soon.

I’ve just spent two hours creating an image optimization module that’s just submitted to Sitecore Marketplace. It will run pngcrush, jpegtran, or whatever image compression utility you prefer on your images in media library.
Continue reading

A better Sitecore publishing dialog

2014-03-11 Update: The just released Sitecore 7.2 has implemented all these features into the product, so this blog post is only valid for 7.1 and below. Thank you Sitecore!

The Sitecore publishing dialog has some flaws that I finally got the chance to fix.

Original Publishing DialogHere is a screenshot of the original publishing dialog from one of our Sitecore setups. The most obvious error you’ll find in the standard dialog is that the list of languages is unsorted. Another strange thing is that the list of languages is filtered on read access for each language. So, if I have read access on the language item (not even LanguageRead), I may publish any items on that language. Eh? When will I ever need to publish items that I can’t edit in the first place? I think LanguageWrite is a more suitable permission.

Another thing that can become an issue, is that anyone can do a complete Re-publish of everything. This shouldn’t ever be done really, unless you have a corrupt database. With a growing database, a Re-publish can have great performance impact. I guess Republish access is only needed for Administrators in most setups.

Publishing targets is also an issue. Continue reading

Sitecore auto publishing agent

There are many reasons to do auto publishing i Sitecore. For example users that forgets to publish their changes, an auto publish will correct that. In a large scale setup, the problem could be the opposite. Too many CM users publishing their changes all the time, so that the CD servers cache gets cleared too often giving the site a bad performance. Then, remove the publish access from the authors and schedule an publish task like every few hours or so.

In an environment with limited languages, the Sitecore.Tasks.PublishAgent is really handy, but its main problem is that the list of languages that should be published is stored in the config files. I wanted to change that. Unfortunately the PublishAgent is almost a sealed class, so I ended up copying the main code of it and created a new class.
Continue reading

Sitecore 7 – Query items that inherits a template

Finally I’ve got a few hours to play with Sitcore 7 and its new LINQ interface to Solr/Lucene. Love it!

Computed index fields are really helpful to speed up things and make things easier. Some fields are enabled by default, but there are also a few pre-configured ones that are disabled by default in the DefaultIndexConfiguration.

One that caught my eye was the “_templates” field. It stores the collection of base templates of an item. It can for example be used for finding items of a specific type, or items that inherits this type. It’s disabled by default, so you have to enable it and rebuild the index.

I soon realised though that the “_templates” field just contains the list from Item.Template.BaseTemplates (plus Item.Template of course). I don’t know yet if this is by design – Sitecore 7 is stil just a preview.

If you need to query items that really inherits a template Continue reading

Database tuning for Sitecore Media Library

There seems to be tons of arguments whether you should store your Media Library files in the database or as files on disk. I usually prefer storing them in the database, since it’s usually easier to manage the data this way. The performance impact is virtually none anyway, since I always use a CDN. But I agree with many of the cons arguments about this as well, so I’ll leave that decision to you.

If you choose database storage, one thing worth considering, is moving the Blobs table into another file store, so that you can put the binaries on a cheaper disk volume. That is if you for example run your primary database on SSD disks, it’d work just fine having the blobs on conventional hard disks.
Continue reading

Dead Urls – Sitecore Module

We tend to spend quite some time on URL management in order to get them nice, SEO friendly in all sorts of ways, but I’ve noticed that most CMS I’ve been in contact with have overseen one of the areas that I think is one of the most important ones. That is proper handling of permanent redirect (301) of URL’s when they change.

The URL structure should of course reflect the site structure, have relevant keywords in it etc. When content authors work with the site, those URL’s may change. The old ones give a “404 Not Found”. Bad from a SEO perspective but it also means current visitors on the site will have downloaded html pages with broken links. My experience is that this escalates when having integrations to other systems that generates items.
Continue reading

Sitecore autoinstalling modules

This is a follow up on yesterdays post regarding autoinstalling NuGet packages into Sitecore.

On request, here is my prototype code on how I use WebActivator to automatically insert/update embedded items into a Sitecore installation. Please note that this is very much prototype code, and it’s really ugly too. But I hope you get the idea of how it works.
Continue reading

Sitecore, Hedgehog TDS, TeamCity and NuGet == true

I’ve been looking some time for a more streamlined development process when building Sitecore modules and share code between Sitecore projects. Separating code into modules is easy, but when you have dependencies on Sitecore items, things becomes a bit more complicated.

The package installation wizard in Sitecore is helpful, and it get’s better with update packages generated by Hedgehog TDS. But I think we can do better. With multiple developers, multiple installations (dev, test, QA, live environments etc), the update process becomes too time consuming and painful.

In addition, I want to be able to create generic modules that can be shared between different Sitecore projects, so I want the code to be built and tested on our build servers and deployed to our local NuGet server.

I’ve done a prototype of this, and I think it worked out quite nice, though there is still a lot of room for improvements.
Continue reading

A common problem with large scale web applications

When working on large scale web application, typically hosted on multiple content delivery servers, regardless if it’s due to high load or a requirement for redundancy, there are quite a few pitfalls to handle.

One of them is on-demand, content delivery web server generated content. My most common case are ordinary web images. Images are typically selected by content authors and they don’t know anything about pixels, bandwidth etc. The people responsible of that are the web developers. The allowed image size constraints should be specified in the aspx/ascx/cshtml files. This means that you utilize some sort of function to resize the image on request of that image and you cache the result, typically as a file on the content deliver web server.

Since you’re good internet citizen, you have version control of your generated images as part of the image URL and you use long time client caching. And since you need speed, you use a Content Delivery Network (CDN) as well. Here I assume you use the site as CDN origin, i.e the images aren’t uploaded to a CDN storage.

Now, using multiple content delivery servers behind a load balancer, this usually causes problems. Let’s say you update something that’ll change the image and its URL (the versioning part). During the publishing sequence of your CMS, you’ll have a state where some content delivery servers are updated and some are not. The time may be short, but it’ll be there (*).

Since we’re talking large scale here, you will now have a problem. A visitor to your newly published site will get an updated html page with the new image URL. The client browser will then load the new image, typically through the CDN, and that request eventually goes into the content delivery cluster. Where will it end up? Possibly (or probably if your load balancer considers backend latency) on a server that hasn’t got the new image yet. We’re still in the middle of a publishing process, right. So, depending on your implementation, you’ll serve an old image, generate a new image based on old data, or give a 404. All are bad.

To make things worse, it’ll probably get cached by your CDN, so now all visitors will get an incorrect image.
Continue reading

Amazon CloudFront+Sitecore bugfix

Serving your Sitecore Media items, on public sites, through a Content Delivery Network (CDN) is always good. I like using Amazon CloudFront since it’s really cheap and easy to set up. For large, high volume sites, I’d look at alternatives as well. But since there is no startup cost or fixed monthly fees etc using CloudFront, I think all small and mid size Sitecore setups should leverage from it.

There are quite many tutorials out there on how to configure Sitecore for CloudFront, so I won’t get into that here. Maybe I’ll post something later..

There are a few minor problems with CloudFront though. One is a nasty bug that spoils proper caching.
Continue reading