Tales from the Evil Empire

Bertrand Le Roy's blog

  • Orchard Harvest is happening October 5-6 in beautiful Alicante, Spain

    The fourth Harvest conference, where the Orchard CMS community gathers to share experiences, talk about the future of the platform, and generally have a great time together, is happening October 5-6 in Alicante. We have a fantastic line-up of speakers, if I may say so myself, including the following fine people from Microsoft: Sébastien Ros, lead developer and Benevolent Dictator of Orchard, and N. Taylor Mullen, developer extraordinaire and super-fun speaker.

  • Building elements for Orchard layouts 1

    Orchard layouts are great, and they’re extensible. In this series of posts, I’ll show how to write your own layout elements. Custom elements are a great way to encapsulate and re-use common bits of layout. Instead of having to build everything from grids, rows, cells, text and media, you can build your layouts from higher-level semantic constructs that make sense for your particular site. In this first post, we’ll build a very simple element: an “subscription” section that is made of a title, two lines of information, a monthly price, and a yearly price.

  • A quick helper to work on JSON streams

    Newtonsoft’s JSON library provides lots of different ways to read JSON documents, including a SAX-like way to work with the document by reading it forward-only: JsonTextReader. This is very advantageous if you’re working with very large documents, especially if they are being streamed from a remote source. Using this kind of API, there is no need to have the whole document loaded in memory at once. The downside is that those API are usually quite unfriendly and low-level: you usually have to move a cursor and read values manually. This is not just tedious, it’s also brittle and typically creates excessive coupling with the structure of the JSON document. Last week, I had to read a large JSON document, and I wanted to explore better ways to perform such tasks, which led me to write a small set of helper methods that make it a lot easier to walk JSON documents using Newtonsoft’s JsonTextReader.

  • Many ways to relate Orchard things, part 6: enumerations

    Enumeration fields are not exactly relationships, but they implement a very similar scenario. Therefore, it's useful to know about them, so that you can use them when they are relevant.

    Enumeration fields are fields that present a set of predefined values, of which one or several can be selected, depending on the field configuration. The values are defined per field, which means that those values can’t be re-used across different content parts. If you have a scenario for re-use of values, then you probably need to use a taxonomy instead.

  • The Evil Empire Strikes Back

    A little more than three years ago, I left Microsoft, and co-founded Nwazet, a hardware company that built cool products for makers. At the end of 2014, we sold our intellectual property to ModMyPi. Since then, I’ve been doing freelance consulting and development under the name Decent Consulting, and I’ve also been building a new CMS based on Node.js: DecentCMS… And today was my first day back at Microsoft as a Senior Program Manager.

  • Many ways to relate Orchard things, part 5: media

    Today’s way of relating Orchard contents is less universal than any of the ones I’ve talked about so far in this series: it will only enable you to attach media, such as images, videos, and audio, to your content items. Still, media have been real content items for a few versions of Orchard, and the media library picker is a very efficient way to add single or multiple media, so this most definitely deserves a post…

  • Many ways to relate Orchard things, part 4: taxonomies

    Taxonomies in Orchard can be seen as glorified tags, and in a way, that’s what they are: you can define multiple classifications for your content items, and assign any number of these classifications to your types. For example, a song could be tagged with a “genre” taxonomy, that defines terms such as “rock”, “blues”, “metal”, “progressive”, or “electro”. The same songs could be tagged with a “mood” taxonomy, with terms such as “epic”, “soft”, “spooky”, or “trashy”. Each song may be tagged with any number of terms from each taxonomy. In other words, there are n-n relationships between songs and taxonomy terms.

    What makes Orchard taxonomies so much better than simple tags is that taxonomy terms are content items, and as such can be extended with additional parts and fields. Our genres and moods, for example, can be enriched with a body part, in order to give them a rich-text description.