Slides from my UmbDkFest presentation

I had the plasure of presenting a case about Trollbeadsuniverse.com at the Umbraco DK Festival last week. the talk focused on how we implemented a large site with many languages and editors in Umbraco.

If you would like to take a look at the slides, I've uploaded the PDF here.

Thanks to the Kraftvaerk guys for making a good event, and thanks to those of you who stopped by. Let me know if you have any questions.

The industry of heroes and dreamers

When I was younger, all I wanted was to be a musician. It was a magical thing where everyone seemed to have a common ground, and were creating something from their heart, which would mean something for a lot of people. Anyone can pick up an instrument, and start practicing, and start creating. Some are great, some are not. But anyone can do it.

Everyone who plays has at some point started by plucking at a guitar string, or playing on the piano in the living room. That is the connection between the beginner and the superstar. The very first notes. The only thing between them is effectively the number of notes played.

So you start by playing a note. Then trying to combine them, and as time goes by, you will get inspired by notes that others have combined and shared with the world. Some were played many years ago, and others have just flowed through the ether for the first time. But they are all there to be heard, and inspire those willing to hear them.

Music is a magical industry where some are raised to fame, for one reason or another. Not only among listeners, but also among fellow musicians all over the world. It is an ever evolving art between creators sitting in the wee hours of the morning, trying to bend the notes just right.

I did never become a musician. And at times I think of what it would have felt like to be one. But I've come to realize that being a developer actually has many similarities to what I think a musician experiences.

We are fortunate to be in an industry that is proud to share experience and knowledge between all levels of developers. We all have the opportunity to learn from our peers, be they colleagues, rising stars, heroes or dinosaurs.

It would not be far fetched to find the developer equivalents to The Beatles, Jimi Hendrix, Eminem or whatever floats your boat. Some have set the bar, and some are pushing the limits. And because of the culture that exists in software development, we all get to know about it. Be inspired by it.

I don't know if other industries have the same luck that we do. Will accountants read interviews with the godfathers of accounting? Are there ground breaking wizkids pushing the boundaries of public transport?

I do know, that I enjoy listening for inspiration no matter if it comes from Miles Davis, Bon Iver or Hanselminutes, and I am proud of our industry for creating that possibility.

 

Thanks to Scott Hanselman, for sparking this thought with his conversation with Paul Lutus.

Deciding on a new camera

For a while now, I have been thinking of changing my camera system. As I know that a lot of you out there on the different social networks who are into photography, I thought i would gather a small blogpost with my thoughts, and see if any of you would enlighten me with your inputs :-)

Why change?

My current camera system is an Olympus E-520 with the standard 14-42mm and 40-150mm lenses. My main issue with this equipment is that it does not seem to perform too well under indoor and other low light conditions. This seems to be confirmed by the review ad dpreview.com. So instead of spending meoney on new lenses for this system, I thought I would try to do a complete swap to improve the performance.

The candidate

The items that I am looking at currently are the following, which fall within the total budget of about DKK 7.500.

Canon EOS 600D
Price DKK  ~4.700
http://www.dpreview.com/products/canon/slrs/canon_eos600d

I want to stay at the entry level houses for now, and i looked at the 500D, 550D and 600D. I would be tempted to go with the 500D which is available at a bargain price currently, but I really would like to get the flip-out screen that comes with the 600D, and which I have been missing quite a few times on my current Olympus.

Canon 18-135mm f3.5-5.6
Price DKK ~2.200
http://www.dpreview.com/products/canon/lenses/canon_18-135_3p5-5p6_is

or

Canon 18-200mm f3.5-5.6
Price DKK ~3.500
http://www.dpreview.com/products/canon/lenses/canon_18-200_3p5-5p6_is

I want an all purpose lens for a certain degree of flexiility when travelling. With my current system, I seem to be changing lens constantly, where these two lenses would each covere the combined range of the Olympus lenses. I am considering the 135mm lens because it should give a better quality image, but still maintain a fair amount of flexibility and at a lower price.

Canon 50mm F1.8
Price DKK ~800
http://www.dpreview.com/products/canon/lenses/canon_50_1p8_ii

At this price I really like the idea of a fixed fast lens, and this one seems to have gotten a lot of nice reviews. it should be able to handle the low light scenarios really well, and should provide some interresting options for depth of field experiments.

Feedback

That concludes my findings so far. I would love to get your feedback and experiences with this or similar equipment, and any other advice you might offer in the search for my new kit :-)

Using inline macros in the Umbraco editor

I've seen the question asked a lot of times on the forum, and it's not always easy to give a good answer to it. "How do I create a macro that works inline in the editor". By default when inserting Macros in the editor, it will force a <p> ir <div> tag to be created around it, which means that the macro will always be a block of content.

In some cases however, it is nice to be able to insert a macro that just creates a single word or phrase inside a sentence. It could be a price of a product, a user specific property, or whatever you might need.

So I came up with the below solution. Of course it has benefits and drawbacks. In short:
Benefit:
- Inline macros

Drawbacks:
- You do not get a nice way of entering data for macro parameters
- The preview snippet is static from the moment you insert it in the editor

At the bottom you will find a link to a complete zipped umbraco install that has been set up with this, so you can have a play with it. It's using SQL CE, so should be easy to get up and running.

If you can live with this, then read on :-). First let's take a look at what the result will look like. When you insert a snippet in the editor it will look like this:
12-sample

In this case my snippet will write the name of the page, and when rendered in the frontend it will look like this:
13-sample

So, how does this work? There a three parts that we need to set up
1. Create a previewable macro
2. Create an aspx page that renders the preview snippet for the editor
3. Configure the TinyMCE editor to use the snippets with the Templates module

Step 1: Previewable macro

Create a macro with a "preview" parameter. In this case I'm creating an xslt macro, but works just fine with razor or usercontrols as well.
2-macroprops

Make the macro aware of a preview state
1-xslt

Step 2: Snippet page

Create an aspx page that will render the macro snippet as well as the macro in preview mode.
3-snippetaspx

My snippet page looks like this. I added the snippet class to a span to make it appear green in the editor. Be aware that this is all in one line to avoid too many spaces in the output when rendered.
4-snippetcontent

Now, for the TinyMCE to be able to reach the page, we need to exclude it from the urls that Umbraco handles. We do this is by adding the folder to the web.config:

Step 3: Enable the templates module in TinyMCE

First we add a few thing to the tinyMceConfig.config file.

The command
6-tinycommand

The plugin
7-tinyplugin

Allow the umbraco:macro tag as valid html
8-tinytags

And add configuration for the templates, so the editor knows which snippets it can get and from which urls.
9-tinycfg

Then we disable the tidy function in umbracoSettings.config, because that will throw an error when it sees the umbraco macro tag.
10-tidyoff

Now, go to the Richtext Editor datatype, and enable the newly added templates module.
11-rtecfg

I also added my own editorStyles stylesheet, but that is standard umbraco stuff :-)

And that is it. Now the macro can be inserted to your text without having to be in a <p> tag. Neato.

I hope this is useful for you. Let me know if you can see any other drawbacks than the ones that I mentioned at the beginning.

Get the demosite here: InlineMacroDemo.zip