Monthly Archives: February 2012

Do not initialise your subclass properties in backbone’s extend!

You definitely don’t want to do this, no no no! It’s one of those time when you’re looking at the console log going “what the’”.. Then you realise your mistake and see how obvious it is.. duh! Background – PHP I’m going start this javascript post with some php.. I think years of writing php code has influenced the mistake. Here’s a typical class definition in PHP. class Test { public $items = array(); public…

Read More

Comparison block helper for handlebars templates

I really like the handlebars template system, it’s straight to the point, efficient, and the added logic layer to mustache makes it practical for most scenarios. One limitation i’ve found was that if block helpers can’t actually evaluate an expression, it only tests if the passed value is already true or false, there’s no evaluation of it. so this: {{#if unicorns == ponies }} That’s amazing, unicorns are actually undercover ponies {{/if}} doesn’t work, bummer.…

Read More

Lemonstand Module – Filebrowser

So I wrote a lemonstand module a while back. We needed a way for a project to give admin users a different way to upload images and insert them in their content area. Essentially, it gives a kind of wordpress-like image upload feature to the rich editor.. It’s very experimental, use at your own risk. Lemonstand Module Filebrowser on Github When writing it, I ended up stuck trying to hack into existing views. I ended…

Read More