A blog about understanding and extending Episerver. May contain traces of posts not concerning Episerver.

Add CultureSpecific to an exisiting block area – keep the data

Recently we built a globalized site in EPiServer 7. When the page was filled with content, the client wished that the block area should be the same for all languages.

Once the page was launched the customer realized that they needed to have different blocks in different languages, which meant that we needed to make the block area CultureSpecific. When making such a change, it means that the master language will keep the value of the block area, while all other languages will have a null value.

To get around this, I wrote a script that loops through all the pages from the master language, then retrieves the other language versions of the same page, and if the block area is null, we set the block area value to the same as the master language.

If you need to do this, make sure that you try this on a development / test environment first.