About Mikael Högberg

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

Sitecore File Watcher Internal Buffer Overflow Exception in 8.1 update-1

After upgrading some of our solutions to Sitecore 8.1 update-1 we started seeing errors in our log files, such as this:

... ERROR Error in FileWatcher. Internal buffer overflow.
Exception: System.IO.InternalBufferOverflowException
Message: Too many changes at once in directory:path-to-data-dir\Data.
Continue reading

Editor friendly language fallback

Language fallback is really nice when working multi lingual websites. It save a lot of time and makes the solution very flexible. However, among content editors it can cause some headaches since the content shown to editors may not be the actual content being published.
Continue reading

Speeding up the Sitecore Experience Editor

If you’ve spent some time with Sitecore 8.x, you’ve probably experienced the tremendously slow SPEAK driven Experience Editor (formerly known as Page Editor). This is due to multiple problems. The design of SPEAK is really chatty and cache is vital, some XHR requests are really slow and some are caused by heavy precompilations.
Continue reading

Thoughts on indexing Sitecore content with Solr

Today, my colleagues stumbled upon a strange behavior in one of our projects. I won’t go into all the details about it, but it let me think about how Sitecore indexes fields and how it can be improved. We use Solr, so at this stage, I don’t know if this applies to Lucene as well, but I guess it does.

We typically auto generate our domain model from a TDS project using a T4 template. Having that, we can easily map all Sitecore template fields to typed properties in our domain model and we can also map those to the fields in a Solr index. This means we can use the same model when using the ContentSearch API as well as with the traditional API. We can also lazy load fields from the original item if they are not marked as stored in the index.
Continue reading

Flatten the Sitecore web database

This post describes a concept of resolving content during publish in Sitecore 8.1, but most of it will apply to older versions as well.

With Sitecore 8.1 we get language fallback out of the box. Previously we’ve had the Partial Language Fallback module written by Alex Shyba. The new built-in one is a rewritten one.
Continue reading

Sitecore 8.1 config changes

With the new version 8.1 of Sitecore we get a some really nice new features that’s been talked about a lot over the last few weeks. In this post I’d like to highlight one of the minor changes that I think is well worth spreading as well, since it makes life a bit easier for us developers.
Continue reading

Managing clone notifications

At yesterdays Nordic Sitecore Conference, I was asked about how we deal with clone notifications in Sitecore. So here I’ll try to do a brief blog post of my thoughts on this and how we’ve solved it. It may be gaps in here and room for improvements, but perhaps it’s a start to get your solution work well in this area.
Continue reading

Multiple item reference indicator in Sitecore Experience Editor

In Sitecore, we build pages adding renderings to a page. Renderings typically have datasources pointing to items carrying the content. Thereby it’s really easy to reuse content. In a scenario where a piece of content is used on multiple pages, it’s maybe not clear to content author that changes to the content will actually affect more pages.

So I wrote a little indicator that will show a warning indicator in the Sitecore Experience Editor (aka Page Editor) when the content of a rendering is being used on other pages as well.
Continue reading

An odd Sitecore field validator

Today I faced a Sitecore website rollout problem I’ve never thought of before. When doing a multi language/multi market solution, it’s common to use cloning or other kinds of fallback techniques. This is typically very good, but sometimes it brings some new problems as well.

The scenario I faced was that I wanted to make sure that certain fields did not inherit any value from standard values, default values or via cloning. In my particular case, I wanted to ensure that certain integration settings where defined for each website, even if the sites were cloned. Maybe not a very common requirement, but here’s another example:

Let’s say you have a field that stores a Google Analytics UA code, maybe that code should be defined on each locations where it’s used. Not inherited between sites. (Depending on how you’ve configured GA of course.)
Continue reading

TDS Sync settings

Update: As of version, released on October 24, 2017, this setting is now default in Team Development for Sitecore Classic. If you upgrade to this version, you may have to hit “Reset” on the ignore fields list. Thank you Charles Turano!

After a fresh install of my whole dev environment onto a new nice machine, I realised that Hedgehog Team Development for Sitecore (TDS) isn’t by default configured the way I like it.

In the Options window in Visual Studio, there is a section for TDS Options. In the Sync Window you can specify a set of field names that the Sync with Sitecore should ignore when comparing Sitecore items with your project items. By default, TDS ignores “__Created by“, “__Owner“, “__Revision“, “__Updated” and “__Updated by” which makes perfectly sense. Essentially, this means that if you open an item in Sitecore and just hit Save, some of those fields will be changed but nothing else. Therefore is no meaning in synchronising those items with you project, unless other fields are changed as well.

TDS Sync settings

For some reason the “__Created” field isn’t there by default and I guess one could argue that it should be, but I found it better to ignore that field as well. The main reason for that is as projects evolve, we may upgrade Sitecore to a newer version or a new team member may join that hasn’t followed the same upgrade path as the rest of the team. Instead (s)he just installs the current version used by everyone else in the team. In this case, Sitecore items will have new Created dates and therefore a whole bunch of items are marked as different from the ones you have in the project.

TL;DR In Visual Studio, open Options, navigate to TDS Options and add “__Created” in the Sync window.

Quick fix for Experience Editor

In later versions of Sitecore, there is a new link field called General Link with Search. As the name says, it’s basically the same as the old one but with an extra search option. In later versions of Sitecore, there’s also an out-of-the-box fix for clearing links in the Experience Editor, implemented in the same way as sitecoreclimber blogged about a few months ago.

Clear LinkHowever, in a clean Sitecore 8 install, the “Clear Link” web editor button item is missing in the core database for General Link with Search. You can solve this by just copying the existing command from General Link.

Sitecore MVC Data Source query support

Sitecore query is a very powerful tool for selecting items and is used in many places in the Sitecore CMS. However, there are a few locations where this is not supported by default, and there are good reasons for that too. One is performance. Sitecore query is powerful but can be far more expensive to execute than referring to an item using a regular Guid. Sitecore often provides you with a search/query tool to find a data source, but it’s only the target Guid that’s stored typically.
Continue reading

Synchronize Sitecore Compatible Rendering

In Sitecore, as well as in all other good CMS’, contents and layouts are separated and there are various ways we can control the rendering of a piece of content. Typically we use Rendering Parameters or Compatible Renderings or a combination of the two. This post will just look into compatible renderings.

When you have two renderings that can render the same piece of content, you edit the Compatible Renderings field of the rendering item. This enables the Replace Rendering button in the Experience Editor (aka Page Editor). It’s worth mentioning that when switching renderings using this technique, the data source etc are being kept.

This adds some maintenance though. If you edit rendering A and say it’s compatible with rendering B, you also have to edit rendering B and say it’s compatible with rendering A. Annoying, right? So let’s solve this.
Continue reading

Sitecore MVP 2015 Winner

Sitecore MVP Technology 2015Thank you Sitecore for awarding me “Technology Most Valuable Professional (MVP)” again! Third year in a row. This year 141 people worldwide are named MVP this year. There are more than 26,000 developers in Sitecore’s global network.

Now it it’s ninth year, Sitecore’s MVP program recognizes individual technology and digital strategy advocates who share their Sitecore passion and expertise to offer positive customer experiences that drive business results. The Sitecore Technology MVP Award recognizes the most active Sitecore experts from around the world who participate in online and offline communities to share their knowledge with other Sitecore partners and customers.

“We are grateful for the leadership, expertise and ongoing contributions that Mikael Högberg has made to the Sitecore community,” said Lars Fløe Nielsen, Co-Founder and senior vice president, technical marketing, Sitecore. “Mikael Högberg has demonstrated mastery of our technology and exemplifies the spirit of Sitecore.”

Again, thank you Sitecore!

First look at Saleae logic analyzer

Sale Logic Pro 16 RedToday I received my long awaited Saleae Logic Pro 16 logic analyzer. This fantastic little device has 16 input channels that can be individually configured as digital or analog inputs. With its USB3 interface, it’s able to capture data at pretty high speed too. Up to 500MS/s (million samples per second) digital and 50MS/s analog, but it drops a bit when using more channels though.

Saleae Logic Pro 16

To give it a first try, I hooked it up to the regular Arduino Uno compatible Sparkfun RedBoard that I already had running. I tapped into the I2C wires and an analogue wire and started sampling. It worked like a charm right away with no trouble at all. The screenshot below is actually from my very first run. A cool and neat detail are the wire colouring that follow the common resistor value coloring.

Saleae Hookup

When writing this, the Pro 16 is brand new and requires the latest beta software. It’s still very simple to install, use, and seems to be quite stable as well. The UI is intuitive and is quite easy to navigate. The protocol analysers are my favourites. Just attach an analyser and tell it what channels corresponds to each line, and it’ll decode all data.

Saleae software

It comes with a lot of protocol analysers for common interfaces, such as I2C, I2S, SPI, 1-Wire, CAN, JTAG, Midi, Modbus, PS/2, USB 1.1, HDMI etc. Now I hope I can find some time to write custom analysers for the DHT22 and WS2812. But it’s always that “spare-time-issue”…

Sitecore 8 preview: new UI

One of the many changes and new features in Sitecore 8 is the new UI. Gone is the old “XP-style” desktop and it’s replaced by a more “Win8-style” modern UI. Under the hood, since a few versions ago, Sitecore is in the transition of replacing Sheer UI with SPEAK (Sitecore Process Enablement and Acceleration Kit) UI.

Sitecore 8 has a new clean, nice looking login screen. Gone are the hidden “Desktop”, “Content Editor”, “Page Editor” and “Launch Pad” options. It takes you directly to a new launch pad where common tasks are easily available. It’s more focused around editors and marketeers, but administrators still find easy access to the Desktop and Content Editor.

The lighthouse is gone
Firing up the Desktop, you find a “Windows 10-style” (?) desktop. Well, think Windows 8 but with a proper start menu, like the way Windows should have been in the first place. The old default lighthouse background image has also done its job by now and is replaced.

At a glance, the Desktop and Content Editor seems to be replaced by SPEAK, but looking under the hood, it hasn’t. Though I haven’t digged too deep into the internals yet, the components are still the same in the Desktop/Content Editor, but they are re-skinned in such way it looks like the other SPEAK UI’s. This has both pros and cons.

The good thing is that most plugins, modules and other adaptations that you’ve implemented or installed, will probably work without giving too much of a headache. That is, if you haven’t provided your own css’ to your plugin of course.

On the downside is that it isn’t SPEAK. Even though we’ve over time learned how to make changes to Sheer UI in Sitecore 6.x/7.x, it wasn’t really meant to be extended (hope I remember right what Jakob Christensen said on Barcelona). The fact that DataView still returns a set of native Items instead of DTO objects and the controls for editing fields are virtually impossible to reuse in a custom way, is holding me back from creating all sorts of really nice stuff.

A new take on multi lingual sites
To me, the ability to version renderings is one of, if not the most, valuable feature in Sitecore 8. In previous Sitecore versions, the fact that the common Rendering field is shared, quite often becomes a show stopper when aiming for a common site structure. So you were left with the only option of having one tree per market/language and all the problems that comes with it. Well, cloning does help, especially combined with custom tools for managing multiple trees and having them in sync, but usually it still generates a lot of overhead and requires extra thoughts.

In version 8, Sitecore has added a new versioned Final Rendering field. The old shared Renderings field is still there, untouched, so existing code will still work. The Final Rendering fields just adds another rendering delta, so the functionality is the same, well proven one, as is already being used in the standard values and clone inheritance structure.

So what does this mean in reality? In my opinion, it means a lot more than meets the eye. You can now build large multi language, multi market web sites in one shared structure, without having to sacrifice too much functionality. Developers will configure default renderings in Standard values, as we’ve always done. Editors of a master site will, when needed, edit the old shared Rendering filed. Local editors can then be given access to edit only this new Final Rendeing field, so that they can’t mess up other language versions. This also makes governance of multiple markets/languages a lot easier.

Sitecore dataviews

Have you ever needed a way of customising the content tree in Sitecore? I had, and got some excellent insights on how to do this, and some more info about Sitecore internals from the fantastic Sitecore support team!

I had a scenario where I wanted to filter out some items from the content tree, in both the Content Editor and from the Navigation bar in the Page Editor, that where not relevant to certain users. In my particular case, I have a common content tree that is translated into many languages, but some sections, such as a news section, contains a lot of locally produced items. Those items typically have only one language version, so those sections becomes very cluttered, with a lot of items that is just irrelevant to all the other content editors. I.e. there are a lot of items that don’t have a version on the current language, and there’s usually no need to translate them either.

So, I wanted a way to hide those non-translated items from the content tree, depending on the current selected language. With some help from Sitecore support, we came up with the idea of implementing our own Master Dataview.
Continue reading

Sitecore 6.0-7.0 and Chrome 37+ showModalDialog()

Since Chrome version 37, the deprecated showModalDialog has been disabled. Firefox is about to do the same and has been sending out deprecation warnings since version 28 as well. Sitecore version 6.0 to 7.0 uses this javascript method to open up dialog boxes, and Sitecore has released a patch for it. Sitecore 7.1 and above does not use this deprecated method.

RTE Show EditorThe patch works well in the Content Editor, but we’ve found that it doesn’t when running Sitecore in Desktop mode. When editing items, the “Show Editor” button no longer works for RichTextEditor fields. Looking at the javascript console you get the error “Cannot find RTE frame object”.
Continue reading

Hello MicroView

MicroView on FingerMy intention was to spend this evening playing around with Sitecore 8 and blog about it, but unfortunately there were some trouble with the distribution of the Technical preview. But today I received a long awaited UPS package with two MicroViews. It’s basically a small Arduino with a 64×48 pixel oled display built into a standard DIP package.

I found the device really simple to work with. Just hook it into to a computer using a FTDI interface and program in with the common Arduino IDE works really well! Geek Ammo and Sparkfun has done a really good job in making a user friendly product. So, instead of the standard “Hello World” program, I decided to try do something a little bit more useful with it as a first project.

In our vacation house in Lappland, about 1000km away from home, I have a little Raspberry PI hooked up with some sensors measuring temperate etc. It sends this data periodically to one of my servers at home. Using another Raspberry PI at home, I made a very simple little script that gets the current sensor values and transmits it to the MicroView over a serial line. The MicroView then reads this data and displays the current indoor and outdoor temperature and the indoor humidity at the vacation house.

Microview WeatherWell, it’s not very pretty, actually it looks quite ugly, but as I write this blog post, it’s only three hours since I unboxed the MicroView. (The poor picture quality doesn’t help.) Now that’s what I call rapid prototyping!

Maybe next project could be showing some of the Sitecore 8 launch pad diagrams of, for example, campaign conversions and visit values, on the MicroView 🙂