<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Matt Brailsford</title>
	<atom:link href="http://blog.mattbrailsford.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mattbrailsford.com</link>
	<description>Just another Umbraco weblog</description>
	<lastBuildDate>Sun, 13 May 2012 09:34:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.mattbrailsford.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matt Brailsford</title>
		<link>http://blog.mattbrailsford.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.mattbrailsford.com/osd.xml" title="Matt Brailsford" />
	<atom:link rel='hub' href='http://blog.mattbrailsford.com/?pushpress=hub'/>
		<item>
		<title>DotLiquid ViewEngine Now Available On The NuGet Gallery</title>
		<link>http://blog.mattbrailsford.com/2012/05/13/dotliquid-viewengine-now-available-on-the-nuget-gallery/</link>
		<comments>http://blog.mattbrailsford.com/2012/05/13/dotliquid-viewengine-now-available-on-the-nuget-gallery/#comments</comments>
		<pubDate>Sun, 13 May 2012 09:29:56 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Packages]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=702</guid>
		<description><![CDATA[Lately I&#8217;ve been playing around with a cool little library called DotLiquid, a templating system ported from the Ruby Liquid library, originally created by the folks at Shopify. The beauty of this templating system is that it is very designer friendly, and is uber easy for anybody to get to grips with. Check out this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=702&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-705" title="dotliquid" src="http://mattbrailsford.files.wordpress.com/2012/05/dotliquid.png?w=460" alt=""   />Lately I&#8217;ve been playing around with a cool little library called <a title="DotLiquid" href="http://dotliquidmarkup.org/" target="_blank">DotLiquid</a>, a templating system ported from the Ruby <a href="http://liquidmarkup.org/" target="_blank">Liquid</a> library, originally created by the folks at <a href="http://www.shopify.com/" target="_blank">Shopify</a>. The beauty of this templating system is that it is very designer friendly, and is uber easy for anybody to get to grips with. Check out this little snippet and see for youself:</p>
<pre>&lt;ul id="products"&gt;
  {% for product in products %}
    &lt;li&gt;
      &lt;h2&gt;{{ product.title }}&lt;/h2&gt;
      Only {{ product.price | format_as_money }}
      &lt;p&gt;{{ product.description | prettyprint | truncate: 200  }}&lt;/p&gt;
    &lt;/li&gt;
  {% endfor %}
&lt;/ul&gt;</pre>
<p>Simple right? One of the other great features of DotLiquid is also how restrictive it is. That might sound like it should be a negative, with most people thinking flexibility is the key, but in reality it means template development is secure and template designers can only have access to what you want them to.</p>
<p>Whilst playing around with DotLiquid, I thought it would be cool if it could be used as an ASP.NET MVC ViewEngine. After a bit of a search though, I wasn&#8217;t able to find one. There were view engines written for Nancy and Jessica, but nothing for ASP.NET MVC. So like any respectable developer, I decided to write one <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>DotLiquid.ViewEngine</strong></p>
<p>To get started, either <a href="https://nuget.org/packages/DotLiquid.ViewEngine" target="_blank">download the view engine from the NuGet gallery</a>, or just install it directly in an ASP.NET MVC project by issuing the command:</p>
<pre>PM&gt; Install-Package DotLiquid.ViewEngine</pre>
<p>Once you have it installed, you are pretty much ready to rock. Simply create your views in your views folder as per normal, but with a .liquid file extension (you&#8217;ll need to prefix your partials / masters with an &#8216;_&#8217; as per the DotLiquid requirement) and just start using the liquid syntax. The rest should just work automatically.</p>
<p>One other important note, and related to the deliberate restrictive nature of DotLiquid, is to make sure that any models passed down to your view, must be ILiquidizable. The simplest way to do this, is to have your ViewModels to just inherit from the DotLiquid Drop class. The ILiquidizable interface simply lets DotLiquid know which properties should be available to the template designer via the Liquid syntax.</p>
<p>It&#8217;s as simple as that.</p>
<p>For more information on the Liquid syntax, checkout the documentation on the <a href="https://github.com/formosatek/dotliquid/wiki/" target="_blank">DotLiquid</a> and <a href="https://github.com/Shopify/liquid/wiki" target="_blank">Liquid</a> sites, and if you give the view engine a try, be sure to<a href="https://bitbucket.org/mattbrailsford/dotliquid.viewengine/issues" target="_blank"> let me know if you have any problems / suggestions</a>. And lastly, if you&#8217;d like to have a poke around the code for the view engine, you can <a href="https://bitbucket.org/mattbrailsford/dotliquid.viewengine/src" target="_blank">find it now over on bitbucket</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/702/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=702&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2012/05/13/dotliquid-viewengine-now-available-on-the-nuget-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2012/05/dotliquid.png" medium="image">
			<media:title type="html">dotliquid</media:title>
		</media:content>
	</item>
		<item>
		<title>The Importance of Local Events</title>
		<link>http://blog.mattbrailsford.com/2012/02/12/the-importance-of-local-events/</link>
		<comments>http://blog.mattbrailsford.com/2012/02/12/the-importance-of-local-events/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 10:11:52 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[digitalbarn]]></category>
		<category><![CDATA[event]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=689</guid>
		<description><![CDATA[So yesterday was the first ever Digital Barn, a local, free event organized by Matt Watson and Kimb Jones in conjunction with Barnsley DMC, and I have got to say, it was a fantastic do. As a developer who has been working on the web for over 12 years now, it can become very easy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=689&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So yesterday was the first ever <a href="http://thedigitalbarn.co.uk/" target="_blank">Digital Barn</a>, a local, free event organized by <a href="https://twitter.com/#!/mwtsn" target="_blank">Matt Watson</a> and <a href="https://twitter.com/#!/mkjones" target="_blank">Kimb Jones</a> in conjunction with <a href="http://www.barnsleydmc.co.uk/" target="_blank">Barnsley DMC</a>, and I have got to say, it was a fantastic do.</p>
<p>As a developer who has been working on the web for over 12 years now, it can become very easy to slip into a comfort zone. I like to think I&#8217;ve read all the right articles, and that what I produce is good quality code. And for the most part, it generally is. But there is always room for improvement. As we grow as designers / developers, it&#8217;s inevitable that we become specialists in certain areas, and start to fall behind in others. For me, that is when the importance of local events can really shine.</p>
<p>It&#8217;s a chance for you to come out of that comfort zone, and to challenge what you think you already know. It&#8217;s a chance for you to checkout subjects that you might not ordinarily look into. And it&#8217;s a chance for you to get out and meet others with similar interests.</p>
<p>The Digital Barn was a great example of this, with talks on various subjects, with folk from near and far turning out. For me personally, there were 2 talks which really challenged my existing conceptions and really inspired me to make some changes. <a href="http://csswizardry.com/" target="_blank">Harry Roberts</a>, Breaking Good Habbits and <a href="http://do-some-thing.co.uk/" target="_blank">Craig Burges</a>, The Mad Scientists of the Information Superhighway.</p>
<p>Harry&#8217;s talk discussed some interesting concepts about CSS and creating more maintainable websites by thinking more semanticly and Craig&#8217;s talk about reigniting the magic of the information superhighyway by encoraging designers and developers to spend more time working on those fun ideas we all have, but never do anything about, really rang true with me.</p>
<p>So it&#8217;s thanks to events like the Digital Barn that we can all take that step out of our comfort zones and open our selves up to ideas we may not have thought of without them.</p>
<p>So with that I&#8217;d like to give a big thanks to Matt and Kimb for organizing the event, and I encourage you to search out a local event near you and see if you can find unexpected inspiration. I for one can&#8217;t wait for the next one.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/689/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/689/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/689/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=689&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2012/02/12/the-importance-of-local-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing Knockout Hotkeys</title>
		<link>http://blog.mattbrailsford.com/2012/02/10/introducing-knockout-hotkeys/</link>
		<comments>http://blog.mattbrailsford.com/2012/02/10/introducing-knockout-hotkeys/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 13:46:24 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[hotkeys]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[knockout]]></category>
		<category><![CDATA[umbraco]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=672</guid>
		<description><![CDATA[For anybody who doesn&#8217;t know, working at Umbraco HQ, every Fridays is Freedom Fridays, in which the whole team take a break from their usual projects, and spend the day doing some personal development. Having spent a fair bit of time playing around with Knockout.js recently (If you haven&#8217;t done already I urge you to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=672&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-673" title="knockout_hotkey" src="http://mattbrailsford.files.wordpress.com/2012/02/knockout_hotkey.png?w=460" alt=""   />For anybody who doesn&#8217;t know, working at Umbraco HQ, every Fridays is Freedom Fridays, in which the whole team take a break from their usual projects, and spend the day doing some personal development.</p>
<p>Having spent a fair bit of time playing around with <a href="http://knockoutjs.com/" target="_blank">Knockout.js</a> recently (If you haven&#8217;t done already I urge you to checkout the <a href="http://blog.mattbrailsford.com/2011/11/22/an-introduction-to-knockout-js/">Introduction to Knockout JS</a> talk I gave at the Umbraco UK Festival back in November), I thought I&#8217;d have a go at writing my own plugin for it.</p>
<p>With that in mind, I introduce to you, <a href="https://bitbucket.org/mattbrailsford/knockout.hotkeys" target="_blank">Knockout Hotkeys</a>.</p>
<p>Knockout Hotkeys is a custom binding plugin for Knockout that allows you to define global hotkeys for elements in your design, allowing you to effectively develop keyboard driven interfaces.</p>
<p>You can define a hotkey by using one of three binding attributes</p>
<ul>
<li>    hotkeydown</li>
<li>    hotkeyup</li>
<li>    hotkeypress</li>
</ul>
<p>The actual syntax is then as follows (NB: Modifier keys should be defined in alphabetical order, ie alt+ctrl+shift):</p>
<p><pre class="brush: xml;">
&lt;input type=&quot;text&quot; data-bind=&quot;hotkeydown: { shift1 : doSomething }&quot; /&gt;
</pre></p>
<p>If you would prefer your key combinations to be a little more readable, you can also define them in the following format:</p>
<p><pre class="brush: xml;">
&lt;input type=&quot;text&quot; data-bind=&quot;hotkeydown: { 'shift+1' : doSomething }&quot; /&gt;
</pre></p>
<p>You can also register multiple hotkey combos within a single binding statement as follows:</p>
<p><pre class="brush: xml;">
&lt;input type=&quot;text&quot; data-bind=&quot;hotkeydown: [{ 'shift+1' : doSomething }, { 'shift+2' : doSomethingElse }]&quot; /&gt;
</pre></p>
<p>In addition to the key combination option, you can also provide an if statement which must be met to allow the hotkey to trigger:</p>
<p><pre class="brush: xml;">
&lt;input type=&quot;text&quot; data-bind=&quot;hotkeydown: { 'shift+1' : doSomething, if: currentItem() == $data }&quot; /&gt;
</pre></p>
<p>Lastley, you can also use a more verbose syntax to allow the creating of dynamic key combinations:</p>
<p><pre class="brush: xml;">
&lt;input type=&quot;text&quot; data-bind=&quot;hotkeydown: { key: 'shift+' + $data.substr(0,1).toLowerCase(),  do: doSomething }&quot; /&gt;
</pre></p>
<p>If you&#8217;d like to give Knockout Hotkeys ago, you can <a href="https://bitbucket.org/mattbrailsford/knockout.hotkeys" target="_blank">grab it now over on bitbucket</a>.</p>
<p>All in all, it&#8217;s been a lot of fun creating this plugin. The more I explore Knockout, the more I love it. From the beautiful syntax, to the amazing documentation. I wish more libraries could be like this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/672/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=672&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2012/02/10/introducing-knockout-hotkeys/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2012/02/knockout_hotkey.png" medium="image">
			<media:title type="html">knockout_hotkey</media:title>
		</media:content>
	</item>
		<item>
		<title>An Introduction to Knockout JS</title>
		<link>http://blog.mattbrailsford.com/2011/11/22/an-introduction-to-knockout-js/</link>
		<comments>http://blog.mattbrailsford.com/2011/11/22/an-introduction-to-knockout-js/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 18:42:14 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=656</guid>
		<description><![CDATA[So for for anybody who attended the Umbraco UK Festival this November, you may or may not have seen my talk on An Introduction to Knockout JS. If you did, you made a great choice. If you didn&#8217;t, shame on you =) Anyway, thanks to the guys at The Cogworks, you can now see my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=656&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-657" title="knockout" src="http://mattbrailsford.files.wordpress.com/2011/11/knockout.jpg?w=460" alt=""   /></p>
<p>So for for anybody who attended the <a href="http://umbracoukfestival.co.uk" target="_blank">Umbraco UK Festival</a> this November, you may or may not have seen my talk on <a href="http://umbracoukfestival.co.uk/programme/" target="_blank">An Introduction to Knockout JS</a>. If you did, you made a great choice. If you didn&#8217;t, shame on you =)</p>
<p>Anyway, thanks to the guys at <a href="http://thecogworks.co.uk/" target="_blank">The Cogworks</a>, you can now see my talk online. If you came to my talk, you get the chance to relive the wonderment, and if you didn&#8217;t come, you can see what a great show you missed.</p>
<p><span style="text-align:center; display: block;"><a href="http://blog.mattbrailsford.com/2011/11/22/an-introduction-to-knockout-js/"><img src="http://img.youtube.com/vi/EI4uhv1noMY/2.jpg" alt="" /></a></span><br />
In addition to the video, you can review my slides over on slideshare&#8230;</p>
<iframe src='http://www.slideshare.net/slideshow/embed_code/10275833' width='460' height='377'></iframe>
<p>&#8230;try out my demos online&#8230;</p>
<p><a href="http://dl.dropbox.com/u/138129/Host/AnIntroductionToKnockoutJs/Demo1/default.htm" target="_blank">Demo 1 &#8211; Colour Picker</a><br />
<a href="http://dl.dropbox.com/u/138129/Host/AnIntroductionToKnockoutJs/Demo2/default.htm" target="_blank">Demo 2 &#8211; Todo List</a></p>
<p>&#8230;and download the source code for yourself</p>
<p><a href="http://dl.dropbox.com/u/138129/Host/AnIntroductionToKnockoutJs/Demo1/download.zip" target="_blank">Demo 1 &#8211; Colour Picker</a><br />
<a href="http://dl.dropbox.com/u/138129/Host/AnIntroductionToKnockoutJs/Demo2/download.zip" target="_blank">Demo 2 &#8211; Todo List</a></p>
<p>I hope everyone who was there, or who watches it online, finds it useful, and gives them enough of a intro to make them want to try it out. It really is a great framework.</p>
<p>So what you waiting for, knock yourself out =)</p>
<p><strong>Update &#8211; February 13th, 2012 10:32</strong></p>
<p>Have updated both the slides and the demos to use the latest Knockout features as demoed at the <a href="http://thedigitalbarn.co.uk/" target="_blank">Digital Barn</a> event.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/656/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=656&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2011/11/22/an-introduction-to-knockout-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2011/11/knockout.jpg" medium="image">
			<media:title type="html">knockout</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Permissions in Umbraco v5 Rock!</title>
		<link>http://blog.mattbrailsford.com/2011/10/30/why-permissions-in-umbraco-v5-rock/</link>
		<comments>http://blog.mattbrailsford.com/2011/10/30/why-permissions-in-umbraco-v5-rock/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 12:44:23 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=646</guid>
		<description><![CDATA[One of the latest features added to Umbraco v5 is a new and improved permissions model. The more I play with this system, the more I realize how powerful it really is. So, in this blog post, I aim to tell you why permissions in v5 rock! =) NB: Permissions were introduced in Alpha 3, however some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=646&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-413" title="safe" src="http://mattbrailsford.files.wordpress.com/2010/09/safe.jpg?w=460" alt=""   />One of the latest features added to Umbraco v5 is a new and improved permissions model. The more I play with this system, the more I realize how powerful it really is. So, in this blog post, I aim to tell you why permissions in v5 rock! =)</p>
<p><strong>NB:</strong> Permissions were introduced in Alpha 3, however some of the features listed below are currently only available in the nightly builds.</p>
<p><strong>More Types<br />
</strong>In Umbraco v4, if you ever looked at the permissions grid, you&#8217;ll notice that each permission related to a context menu item in the content tree. So in v4, permissions basically allowed you to see or not see a specific menu item. In v5, we continue to support this mechanism, but we also allow none menu item related permissions aswell, which pretty much allows us to everything else detailed in this article.</p>
<p><strong>Better Integration<br />
</strong>In v5, we not only block access to menu items, but we can also block direct access to the associated controller actions, so even if someone jumps to an editor screen directly, they still can&#8217;t get access.</p>
<p>In addition, we also support toolbar buttons to require permissions, which means users only get to see the buttons they have permission to see. Don&#8217;t have the publish permission? then you don&#8217;t see the publish button =)</p>
<p>And finally, permissions in v5 work with all hive providers, meaning any tree using a hive provider for it&#8217;s data source now supports permissions (protected media anybody?), including third party providers. With this addition, it means permissions are no longer just the domain of the content tree.</p>
<p><strong>Multi-User Group Support<br />
</strong>In v4, users could only belong to one User Group, meaning that you could end up creating a lot of User Groups with a lot of cross over, just so you could get the right permission level you wanted for a user. Well, in v5, we now have Multi-User Group support, which means a user can now belong to multiple user groups at once. This means you can maintain fewer, more focused user groups, and just add users to, or remove users from, those groups as needed. And if there is any explicit overlap with any given permission, a &#8220;Deny&#8221; permission, will always take presidence over an &#8220;Allow&#8221; permission.</p>
<p><strong>Improved UI<br />
</strong>We haven&#8217;t just looked at the permissions functionality, but also how we go about setting permissions. In v5 we introduced a new permissions grid to make it simpler to see what is going on. On any node in the tree, you can click the permissions option and see the current nodes permissions. The new permissions grid can show you it&#8217;s inherited value, and allows you to override a value easily. Additionally, any changes are easily identifiable with the previous value taking on a grey background, and a little icon being added next to the permission name to signify a change.</p>
<p><img class="size-full wp-image-647 alignnone" title="permissions-grid" src="http://mattbrailsford.files.wordpress.com/2011/10/permissions-grid.jpg?w=460&h=539" alt="" width="460" height="539" /></p>
<p><strong>Custom Permissions<br />
</strong>And finally, as with most things in v5, Permissions are extendible. This means, package developers can introduce their own permissions. It&#8217;s as simple as creating a class that extends our base permission class, then just use our UmbracoAuthorize attribute on any menu items, controller actions or toolbar buttons you want protected.</p>
<p>Well that&#8217;s about it as it stands today, but we are looking to push permissions even further, for example, in the future we&#8217;d like to add the possibility of adding permissions to EntitySchemas thus allowing us to allow / deny access to specific properties of an entity.</p>
<p>So hopefully you now see some of the improvements in the permissions model in v5, and how these improvements make the whole system more secure and extendible. And as always, if you do have any questions, don&#8217;t hesitate to leave a comment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/646/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/646/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=646&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2011/10/30/why-permissions-in-umbraco-v5-rock/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/09/safe.jpg" medium="image">
			<media:title type="html">safe</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2011/10/permissions-grid.jpg" medium="image">
			<media:title type="html">permissions-grid</media:title>
		</media:content>
	</item>
		<item>
		<title>Automating Umbraco v5 Package Creation Using MSBuild</title>
		<link>http://blog.mattbrailsford.com/2011/09/30/automating-umbraco-v5-package-creation-using-msbuild/</link>
		<comments>http://blog.mattbrailsford.com/2011/09/30/automating-umbraco-v5-package-creation-using-msbuild/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 20:25:14 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=631</guid>
		<description><![CDATA[A little while ago I blogged about how I automate my package creation in Umbraco v4 using some custom MSBuild tasks I wrote. Since then, I&#8217;ve been lucky enough to join the Umbraco HQ and get some early exposure to Umbraco v5 (aka Jupiter). One of the changes in v5 is around how packages work, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=631&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-482" title="arm" src="http://mattbrailsford.files.wordpress.com/2010/11/arm.jpg?w=460" alt=""   />A little while ago I blogged about <a title="Automating Umbraco Package Creation Using MSBuild" href="http://blog.mattbrailsford.com/2010/11/13/automating-umbraco-package-creation-using-msbuild/">how I automate my package creation in Umbraco v4 using some custom MSBuild</a> tasks I wrote. Since then, I&#8217;ve been lucky enough to join the <a title="Umbraco HQ" href="http://umbraco.com/about-us/team.aspx">Umbraco HQ</a> and get some early exposure to<a title="Umbraco Jupiter" href="http://jupiter.umbraco.org/"> Umbraco v5 (aka Jupiter)</a>. One of the changes in v5 is around how packages work, moving away from the proprietary package manifests used in v4, in favour of the standard NuSpec manifests used in <a title="NuGet" href="http://nuget.codeplex.com/">NuGet</a> packages. This means Umbraco packages are now just plain old NuGet packages.</p>
<p>With this change, I thought I&#8217;d have a go at updating my build scripts so that I can continue to automate the package creation process. After a quick search, I couldn&#8217;t find any specific MSBuild tasks for NuGet package creation, so I went and wrote some =)</p>
<p>So here is the updated process.</p>
<p><strong>Prerequisites</strong></p>
<p>As I&#8217;m using MSBuild, you&#8217;ll obviously need to have the .NET framework installed. In addition, you&#8217;ll need to <a title="NuGet Command Line" href="http://nuget.codeplex.com/releases/view/58939">download the NuGet.exe command line executable from Codeplex</a>, and <a title="MSBuild.NuGet.Tasks" href="http://www.mattbrailsford.com/downloads/MSBuild.NuGet.Tasks.zip">my custom MSBuild.NuGet.Tasks dll and targets file</a>.</p>
<p><strong>Project Structure</strong></p>
<p>Now this is completely up to you, but for this example and for my own projects, this is the project structure I use.</p>
<ul>
<li><strong>Lib </strong>- Referenced 3rd party libraries</li>
<li><strong>Src </strong>- Source code for your application
<ul>
<li><strong>MyProject</strong> - Project folder
<ul>
<li><strong>MyProject.proj</strong> - Project file</li>
</ul>
</li>
</ul>
</li>
<li><strong>Tools</strong> - Build tools
<ul>
<li><strong>MSBuildNuGetTasks</strong> - The NuGet MSBuild tasks</li>
<li><strong>NuGet</strong> - The NuGet command line executable</li>
</ul>
</li>
<li><strong>MyProject.sln</strong> &#8211; The project solution file</li>
<li><strong>Package.build.cmd </strong>- The command file for triggering the package build process</li>
<li><strong>Package.build.xml </strong>- The package MSBuild script</li>
<li><strong>Package.nuspec</strong> - The package manifest file</li>
</ul>
<p><strong>Package.nuspec</strong></p>
<p>This is the manifest file for your package. The manifest is responsible for holding all the metadata about your package such as name, version and description aswell as listing the package files and, in the future, your package dependencies.</p>
<p>If you actually looked at the package manifest files in v4, then these will actually look pretty similar. The namespaces might have changed a little, but the function is exactly the same.</p>
<p>What follows is a demo manifest file.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;package xmlns=&quot;http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd&quot;&gt;
  &lt;metadata&gt;
    &lt;id&gt;MyPackage&lt;/id&gt;
    &lt;version&gt;0.0.0&lt;/version&gt;
    &lt;title&gt;My Package&lt;/title&gt;
    &lt;authors&gt;Matt Brailsford&lt;/authors&gt;
    &lt;owners&gt;Matt Brailsford&lt;/owners&gt;
    &lt;projectUrl&gt;http://blog.mattbrailsford.com&lt;/projectUrl&gt;
    &lt;requireLicenseAcceptance&gt;false&lt;/requireLicenseAcceptance&gt;
    &lt;description&gt;My Package Description&lt;/description&gt;
    &lt;summary&gt;My Package Summary&lt;/summary&gt;
    &lt;language /&gt;
  &lt;/metadata&gt;
  &lt;files /&gt;
&lt;/package&gt;
</pre></p>
<p><strong>Package.build.xml</strong></p>
<p>This is the build script for the package, and is responsible for orchestrating the build process. This hasn&#8217;t actually changed that much from my original build script, with the only real difference being a different packaging task (the ManifestUpdate task has also been updated, but the signature is pretty much the same as before). The options on the pack task exactly match those of the <a title="NuGet Pack Command" href="http://docs.nuget.org/docs/reference/command-line-reference#Pack_Command">pack command of the NuGet command line tool</a>.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;Project xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot; DefaultTargets=&quot;Package&quot;&gt;

  &lt;!--
  	****************************************
  	* IMPORTS
	****************************************
  --&gt;
  &lt;PropertyGroup&gt;
  	&lt;MSBuildNuGetTasksPath&gt;$(MSBuildProjectDirectory)\Tools\MSBuildNuGetTasks&lt;/MSBuildNuGetTasksPath&gt;
  &lt;/PropertyGroup&gt;

  &lt;Import Project=&quot;$(MSBuildNuGetTasksPath)\MSBuild.NuGet.Tasks.Targets&quot; /&gt;

  &lt;!--
  	****************************************
  	* PROPERTIES
	****************************************
  --&gt;
  &lt;PropertyGroup&gt;
	&lt;PackageVersion&gt;1.0&lt;/PackageVersion&gt;
  &lt;/PropertyGroup&gt;

  &lt;PropertyGroup&gt;
	&lt;RootDir&gt;$(MSBuildProjectDirectory)&lt;/RootDir&gt;
	&lt;BuildDir&gt;$(RootDir)\Build&lt;/BuildDir&gt;
	&lt;PackageDir&gt;$(RootDir)\Package&lt;/PackageDir&gt;
	&lt;ProjectDir&gt;$(RootDir)\Src\Namespace.MyProject&lt;/ProjectDir&gt;
  &lt;/PropertyGroup&gt;

  &lt;!--
  	****************************************
  	* TARGETS
	****************************************
  --&gt;

  &lt;!-- CLEAN --&gt;
  &lt;Target Name=&quot;Clean&quot;&gt;
	&lt;RemoveDir Directories=&quot;$(BuildDir)&quot; Condition=&quot;Exists('$(BuildDir)')&quot; /&gt;
  	&lt;RemoveDir Directories=&quot;$(PackageDir)&quot; Condition=&quot;Exists('$(PackageDir)')&quot; /&gt;
	&lt;MakeDir Directories=&quot;$(BuildDir)&quot; /&gt;
  	&lt;MakeDir Directories=&quot;$(PackageDir)&quot; /&gt;
  &lt;/Target&gt;

  &lt;!-- COMPILE --&gt;
  &lt;Target Name=&quot;Compile&quot; DependsOnTargets=&quot;Clean&quot;&gt;
	&lt;MSBuild Projects=&quot;$(ProjectDir)\Namespace.MyProject.csproj&quot; /&gt;
  &lt;/Target&gt;

  &lt;!-- PREPAIRE FILES --&gt;
  &lt;Target Name=&quot;PrepairFiles&quot; DependsOnTargets=&quot;Compile&quot;&gt;
    &lt;ItemGroup&gt;
      &lt;BinFiles Include=&quot;$(ProjectDir)\Bin\Namespace.MyProject.dll&quot; /&gt;
      &lt;ViewFiles Include=&quot;$(ProjectDir)\Views\*.cshtml&quot; /&gt;
      &lt;PackageFile Include=&quot;$(RootDir)\Package.nuspec&quot; /&gt;
    &lt;/ItemGroup&gt;
	&lt;Copy SourceFiles=&quot;@(BinFiles)&quot; DestinationFolder=&quot;$(BuildDir)\lib&quot; /&gt;
	&lt;Copy SourceFiles=&quot;@(ViewFiles)&quot; DestinationFolder=&quot;$(BuildDir)\content\views&quot; /&gt;
	&lt;Copy SourceFiles=&quot;@(PackageFile)&quot; DestinationFolder=&quot;$(BuildDir)&quot; /&gt;
  &lt;/Target&gt;

  &lt;!-- MANIFEST --&gt;
  &lt;Target Name=&quot;Manifest&quot; DependsOnTargets=&quot;PrepairFiles&quot;&gt;
	&lt;ItemGroup&gt;
      &lt;ManifestFiles Include=&quot;$(BuildDir)\**\*&quot; Exclude=&quot;$(BuildDir)\Package.nuspec&quot; /&gt;
    &lt;/ItemGroup&gt;
	&lt;ManifestUpdate
		ManifestFile=&quot;$(BuildDir)\Package.nuspec&quot;
		WorkingDirectory=&quot;$(BuildDir)&quot;
		Version=&quot;$(PackageVersion)&quot;
	    Files=&quot;@(ManifestFiles)&quot; /&gt;
  &lt;/Target&gt;

  &lt;!-- PACKAGE --&gt;
  &lt;Target Name=&quot;Package&quot; DependsOnTargets=&quot;Manifest&quot;&gt;
	&lt;Pack NuGetExePath=&quot;$(RootDir)\Tools\NuGet\NuGet.exe&quot;
		ManifestFile=&quot;$(BuildDir)\Package.nuspec&quot;
		BasePath=&quot;$(BuildDir)&quot;
		OutputDirectory=&quot;$(PackageDir)&quot;
		Verbose=&quot;true&quot; /&gt;
  &lt;/Target&gt;

&lt;/Project&gt;
</pre></p>
<p><strong>Package.build.cmd</strong></p>
<p>This is a simple command script and is responsible for triggering the build process. Again, this hasn&#8217;t changed greatly from before, with the only change being and update to the msbuild executable used.</p>
<p><pre class="brush: plain;">C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Package.build.xml</pre></p>
<p><strong>Conclusion</strong></p>
<p>All in all, there haven&#8217;t been any huge changes to the script from before, with the majority of the changes being hidden away in the MSBuild tasks. Hopefully this will make it easier for people who used my script before to make the leap into v5. As an added bonus, since Umbraco packages in v5 are just plain old NuGet packages, these MSBuild tasks can actually be used for creating any other kind of NuGet packages aswell.</p>
<p>Happy packaging =)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/631/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=631&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2011/09/30/automating-umbraco-v5-package-creation-using-msbuild/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/11/arm.jpg" medium="image">
			<media:title type="html">arm</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Desktop Media Uploader Doesn&#8217;t Support Custom Folders</title>
		<link>http://blog.mattbrailsford.com/2011/06/23/why-desktop-media-uploader-doesnt-support-custom-folders/</link>
		<comments>http://blog.mattbrailsford.com/2011/06/23/why-desktop-media-uploader-doesnt-support-custom-folders/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 12:20:39 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=625</guid>
		<description><![CDATA[On a few occasions now, I&#8217;ve been asked whether it&#8217;s possible for the Desktop Media Uploader for Umbraco package could be made to support custom folders, to which, unfortunatley, the current answer is no. Rather than explain the reasons why every time the question pops up, I just thought I&#8217;d write a quick blog post instead. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=625&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-373" title="logo" src="http://mattbrailsford.files.wordpress.com/2010/07/logo.jpg?w=460" alt=""   /></p>
<p>On a few occasions now, I&#8217;ve been asked whether it&#8217;s possible for the <a href="http://our.umbraco.org/projects/website-utilities/desktop-media-uploader" target="_blank">Desktop Media Uploader</a> for <a href="http://umbraco.com/" target="_blank">Umbraco </a>package could be made to support custom folders, to which, unfortunatley, the current answer is no. Rather than explain the reasons why every time the question pops up, I just thought I&#8217;d write a quick blog post instead.</p>
<p><strong>1. Umbraco media has no &#8220;Folder&#8221; concept<br />
</strong>The first reason is that Umbraco doesn&#8217;t really have the concept of a &#8220;Folder&#8221;. In Umbraco Folders and Files are the same, they are all just Media Types with differing &#8220;allowed child media types&#8221;. Ok, so I could check all media types to see if they allow sub media types, but that leads me on to reason 2.</p>
<p><strong>2. Desktop Media Uploads are created File first </strong><br />
When uploading a file via Desktop Media Uploader, the server automatically works out what Media Type to create a media item based upon it&#8217;s extension. The problem with this is that that it&#8217;s not until the file is uploaded that you would be able to discover whether the file can actually be created in the desired location. By only supporting the &#8220;Folder&#8221; Media Type, we don&#8217;t have that problem, as the &#8220;Folder&#8221; type can handle all Media Types, or, if it can&#8217;t, we can be sure at a bare minimum it can support the &#8220;File&#8221; Media Type as a fall back. With a custom folder, it could be possible to have no fall back media type, leaving us no option to deny the upload and report an error.</p>
<p><strong>3. Folders don&#8217;t exist</strong><br />
The final reason, and this is more to do with the actual uploading of folders, is the fact that folders don&#8217;t actually have any physical attributes to be able to discover how to handle them. With files, we can check the file extension, and decide how to handle it, but with folders, that&#8217;s not possible. Team this then with &#8220;File first&#8221; upload issue mentioned above, and you can really start to get into a mess. What if you upload a folder that is not allowed in that location? All files in that folder would fail, and it would require the user to then log in to the CMS and rectify the issue.</p>
<p>I&#8217;m pretty sure that these things may be possible to fix, but the point of Desktop Media Uploader has always been to suite the largest majority of Umbraco users, and to not over complicate the process. I have made it extendable by supporting custom Media Types for files, but in my honest opinion, supporting custom folders just isn&#8217;t worth the payoff.</p>
<p>That said, Desktop Media Uploader is an open source package, and users are more than welcome to look at implementing this themselves, and if anyone was to do this, I&#8217;d be more than happy to review the code and merge the changes in if feel they don&#8217;t compromise the current  functionality.</p>
<p><a href="http://dmu4umb.codeplex.com/SourceControl/list/changesets">http://dmu4umb.codeplex.com/SourceControl/list/changesets</a></p>
<p>Happy uploading.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/625/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/625/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/625/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/625/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/625/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/625/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/625/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/625/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/625/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/625/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/625/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/625/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/625/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/625/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=625&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2011/06/23/why-desktop-media-uploader-doesnt-support-custom-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/07/logo.jpg" medium="image">
			<media:title type="html">logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Anatomy of an Umbraco Document</title>
		<link>http://blog.mattbrailsford.com/2011/04/07/anatomy-of-an-umbraco-document/</link>
		<comments>http://blog.mattbrailsford.com/2011/04/07/anatomy-of-an-umbraco-document/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 12:17:18 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=608</guid>
		<description><![CDATA[Having used Umbraco now for nearly 2 years, I tend to take for granted my core understanding of how the system really works. It&#8217;s only when helping out others do I realize that it&#8217;s not always that easy to grasp for someone new to the platform. My usual stock answers when someone asks how to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=608&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mattbrailsford.files.wordpress.com/2011/04/thumb.jpg"><img class="alignright size-full wp-image-609" title="thumb" src="http://mattbrailsford.files.wordpress.com/2011/04/thumb.jpg?w=460" alt=""   /></a>Having used <a href="http://www.umbraco.co" target="_blank">Umbraco</a> now for nearly 2 years, I tend to take for granted my core understanding of how the system really works. It&#8217;s only when helping out others do I realize that it&#8217;s not always that easy to grasp for someone new to the platform. My usual stock answers when someone asks how to get started is to point them to the <a href="http://umbraco.com/products/training" target="_blank">training courses</a>, the<a href="http://umbraco.tv" target="_blank"> umbraco videos</a> or just to get involved in the <a href="http://our.umbraco.org/" target="_blank">forums</a>.</p>
<p>Today however, I was helping out a <a href="http://twitter.com/mcdarke" target="_blank">newcomer to Umbraco</a> who asked what to me was a very fundamental question:</p>
<blockquote><p>@mcDarke is there like a diagram that shows the architecture of umbraco..?</p></blockquote>
<p>What a great question. Pretty much every Umbraco developer will have asked that question at some point, but yet the answer to his question was &#8220;no&#8221;. Rather than just just saying no though, and risking the loss of another potential member of the already awesome community, I thought I&#8217;d quickly draw one myself, so here it is, the anatomy of an Umbraco page.</p>
<p><a href="http://mattbrailsford.files.wordpress.com/2011/04/8ndrw.jpg"><img class="alignleft size-full wp-image-610" title="8ndrw" src="http://mattbrailsford.files.wordpress.com/2011/04/8ndrw.jpg?w=460&h=345" alt="" width="460" height="345" /></a></p>
<p>Needless to say, it was exactly what he needed.</p>
<blockquote><p>@mcDarke that is what I wanted basically&#8230;lol&#8230;.THANKS&#8230;.Umbraco guys are cool</p></blockquote>
<p>It was only after it got retweeted several times though that I truly realized just how helpful the diagram is, so instead of just letting it get lost in the twittersphere, I thought it would be a good idea to create a blog post around it so that others might find it as they join the community.</p>
<p>I hope this goes some ways to explaining to newcomers what us Umbraco veterans take for granted. And if not, by all means leave a comment and I&#8217;ll see if I can improve it.</p>
<p><strong>Update &#8211; April 7th, 2011 14:07</strong></p>
<p>If you are after a diagram of the Umbraco database structure, then be sure to checkout Hendy Racher&#8217;s posts on the subject:</p>
<p><a href="http://blog.hendyracher.co.uk/umbraco-database-part-1/">http://blog.hendyracher.co.uk/umbraco-database-part-1/<br />
</a><a href="http://blog.hendyracher.co.uk/umbraco-database-part-2/">http://blog.hendyracher.co.uk/umbraco-database-part-2/</a></p>
<p>And there is also a really detailed database diagram by the guys at <a href="http://snipersystems.co.nz" target="_blank">Sniper Systems</a> over here:</p>
<p><a href="http://snipersystems.co.nz/community/umbracodb.png">http://snipersystems.co.nz/community/umbracodb.png</a></p>
<p><strong>Update &#8211; April 8th, 2011 04:40</strong></p>
<p>Whilst the aim of my diagram was to sum up the core concept of Umbraco as simply as possible, Jesper Hauge has done a nice job of creating a more thorough diagram of all the parts that make up a Document. So if you find my diagram lacking in any way, you may want to head over to his blog and <a href="http://blog.claudihauge.dk/post/4421023625/not-wanting-to-rain-on-mattbrailsford-s-parade" target="_blank">take a look at his version</a>. Nice work Jesper.</p>
<p><strong>Update &#8211; June 7th, 2011 07:35</strong></p>
<p><strong></strong>Thanks to Adam Shallcross over at <a href="http://thecogworks.co.uk" target="_blank">The Cogworks</a>, another version of my diagram has been made available. This one is available in .EPS &amp; .PDF formats, and is a little more presentation friendly. You can <a href="http://dl.dropbox.com/u/138129/anatomy-of-an-umbraco-document.zip" target="_blank">grab a copy right here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/608/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/608/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/608/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/608/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/608/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/608/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/608/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/608/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/608/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/608/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/608/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/608/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/608/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/608/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=608&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2011/04/07/anatomy-of-an-umbraco-document/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2011/04/thumb.jpg" medium="image">
			<media:title type="html">thumb</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2011/04/8ndrw.jpg" medium="image">
			<media:title type="html">8ndrw</media:title>
		</media:content>
	</item>
		<item>
		<title>Easily Serve Any Folder in IIS Express</title>
		<link>http://blog.mattbrailsford.com/2011/03/14/easily-serve-any-folder-in-iis-express/</link>
		<comments>http://blog.mattbrailsford.com/2011/03/14/easily-serve-any-folder-in-iis-express/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 18:49:22 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=596</guid>
		<description><![CDATA[For a long time, whenever I&#8217;ve been developing a site, I would always set it up in IIS with a custom host header and modify my windows hosts file to wire it all up. I know a lot of developers don&#8217;t go to this extent, instead plumping to only run it via Visual Studio and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=596&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-597" title="IISExpress" src="http://mattbrailsford.files.wordpress.com/2011/03/iisexpress.jpg?w=460" alt=""   />For a long time, <a href="http://blog.mattbrailsford.com/2010/07/14/visual-studio-project-structure-for-umbraco/" target="_blank">whenever I&#8217;ve been developing a site</a>, I would always set it up in IIS with a custom host header and modify my windows hosts file to wire it all up. I know a lot of developers don&#8217;t go to this extent, instead plumping to only run it via Visual Studio and Cassini. I&#8217;ve never been a fan of this way of working, mainly because I like to have access to my sites at all times, without having to launch Visual Studio (especially if I&#8217;m developing an <a href="http://www.umbraco.com" target="_blank">Umbraco </a>site, and all I need to do is update some CSS or something which I can do easily and quickly via the UI). The downside to setting sites up in IIS though, is that it does add extra steps to the beginning of a project, which can get tedious.</p>
<p>After reading a <a href="http://www.aaron-powell.com/serverhere" target="_blank">blog post by Aaron Powell</a>, it got me thinking though. Why not use <a href="http://learn.iis.net/page.aspx/868/iis-express-overview/" target="_blank">IIS Express</a> to dynamically serve a directory as and when I need it? So with that, I knocked together a simple .vbs script you can drop in your &#8220;Send To&#8221; context menu folder (<span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;font-size:12px;line-height:18px;white-space:pre;">C:\Users\[YOUR_USERNAME]\AppData\Roaming\Microsoft\Windows\SendTo\)</span>, which will launch an IIS Express instance with it&#8217;s path attribute set to the &#8220;Sent&#8221; folders path, and it&#8217;s port attribute set to a random number between 1024 and 9999. The script will also then launch the generated URL in your default web browser. When you want to shutdown the web server, you can stop it using the IIS Express System Tray context menu.</p>
<p>If you&#8217;d like to try this yourself, just drop the following into a .vbs file and save it to your &#8220;Send To&#8221; folder.</p>
<p><pre class="brush: vb;">
' Init randomization
Randomize

' Set random port number
Dim port
port = Int(Rnd() * 8974) + 1025

' Launch IIS Express / Browser
Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
WshShell.Run &quot;&quot;&quot;%programfiles%\iis express\iisexpress&quot;&quot; /path:&quot;&quot;&quot; &amp; WScript.Arguments.Item(0) &amp; &quot;&quot;&quot; /port:&quot; &amp; CStr(port) &amp; &quot; /systray:true&quot;, 0, False
WshShell.Run &quot;http://localhost:&quot; &amp; CStr(port), 9, False
Set WshShell = Nothing
</pre></p>
<p><strong>UPDATE – March 15, 2011 12:25</strong></p>
<p>As highlighted by Lee Kelleher in the comments, if you are using a 64bit OS, then please make sure to change %programfiles% to %programfiles(x86)%</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/596/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=596&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2011/03/14/easily-serve-any-folder-in-iis-express/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2011/03/iisexpress.jpg" medium="image">
			<media:title type="html">IISExpress</media:title>
		</media:content>
	</item>
		<item>
		<title>Caching an Umbraco Macro by QueryString Parameter</title>
		<link>http://blog.mattbrailsford.com/2011/02/01/caching-an-umbraco-macro-by-querystring-parameter/</link>
		<comments>http://blog.mattbrailsford.com/2011/02/01/caching-an-umbraco-macro-by-querystring-parameter/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 10:38:51 +0000</pubDate>
		<dc:creator>Matt Brailsford</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.mattbrailsford.com/?p=518</guid>
		<description><![CDATA[One of the many great features built in to Umbraco that I use on a daily basis, is it&#8217;s ability to cache the output of your Macros. This is great if you have a processor intensive Macro that doesn&#8217;t change too often, or if you have a high traffic site, and want to maximise on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=518&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the many great features built in to <a href="http://umbraco.org/" target="_blank">Umbraco</a> that I use on a daily basis, is it&#8217;s ability to cache the output of your Macros. This is great if you have a processor intensive Macro that doesn&#8217;t change too often, or if you have a high traffic site, and want to maximise on response times. The best thing about this, is just how easy it is to do.</p>
<p>Within the macro properties tab, simply set the cache duration and optionaly check one or more options on how you want to cache the Macro.</p>
<p><img class="aligncenter size-full wp-image-526" title="cache" src="http://mattbrailsford.files.wordpress.com/2010/11/cache1.jpg?w=460&h=117" alt="" width="460" height="117" /></p>
<p>If no options are checked, the Macro will be cached for the cache period regardless. Checking the <strong>Cache by Page</strong> option, caches the Macros output on a page per page basis, and checking <strong>Cache Personlized</strong> caches the Macros output per Member. You can also combine the two options to cache on a per page and per Member basis.</p>
<p>For me though, there is one option missing, which is the ability to cache a Macro based upon a QueryString value. This is needed for things like paged lists, or where you have one page, that does multiple tasks based upon a QueryString parameter (You could get around this by using URL rewriting, but that&#8217;s not always an option). Recently, <a href="http://www.darren-ferguson.com/2010/10/19/umbraco-level-2-training-in-the-uk-be-the-first-to-be-certified" target="_blank">a few of us</a> stumbled across a solution.</p>
<p>When you set a Macro to cache, Umbraco generates a key to cache that Macro by.</p>
<p><pre class="brush: xml;">&lt;umbraco:Macro Alias=&quot;TestMacro&quot; runat=&quot;server&quot;&gt;&lt;/umbraco:Macro&gt;</pre></p>
<p><img class="aligncenter size-full wp-image-538" title="cache2" src="http://mattbrailsford.files.wordpress.com/2010/11/cache21.jpg?w=460&h=112" alt="" width="460" height="112" /></p>
<p>In the example above, because we have the <strong>Cache by Page</strong> option set, the key is made up of the page id, and the Macro alias. One usefull thing to know about how this key is generated (and what will ultimatley make caching by QueryString possible) is that if we have any parameters defined on the Macro, the value of these will also be included.</p>
<p><pre class="brush: xml;">&lt;umbraco:Macro Alias=&quot;TestMacro&quot; runat=&quot;server&quot; TestParam=&quot;testparam&quot;&gt;&lt;/umbraco:Macro&gt;</pre></p>
<p><img class="aligncenter size-full wp-image-541" title="cache3" src="http://mattbrailsford.files.wordpress.com/2010/11/cache3.jpg?w=460&h=112" alt="" width="460" height="112" /></p>
<p>In the example above, our Macro now has a parameter defined with its value set to &#8220;<strong>testparam</strong>&#8220;, which has also been included in the cache key. I know what you are thinking, &#8220;but this is a hardcoded value&#8221;, and you are right, but there is a way to set a Macro parameter to a QueryString value. This is done using the [@...] <a href="http://our.umbraco.org/wiki/reference/templates/umbracomacro-element/macro-parameters/advanced-macro-parameter-syntax" target="_blank">Macro parameter syntax</a>.</p>
<p><pre class="brush: xml;">&lt;umbraco:Macro Alias=&quot;TestMacro&quot; runat=&quot;server&quot; TestParam=&quot;[@MyQueryStringKey]&quot;&gt;&lt;/umbraco:Macro&gt;</pre></p>
<p>Now when we request our page, the <strong>TestParam </strong>property is set to the value of the <strong>MyQueryStringKey </strong>parameter, which in turn is then used as the cache key for the Macro.</p>
<p><img class="aligncenter size-full wp-image-549" title="cache4" src="http://mattbrailsford.files.wordpress.com/2010/11/cache4.jpg?w=460&h=112" alt="" width="460" height="112" />Any change to the <strong>MyQueryStringKey </strong>will result in a new cache key, and will create a new cached instance of the Macro.</p>
<p><img class="aligncenter size-full wp-image-550" title="cache5" src="http://mattbrailsford.files.wordpress.com/2010/11/cache5.jpg?w=460&h=112" alt="" width="460" height="112" /></p>
<p>One final little tip. The cache key is actually generated based upon the attributes defined on the Macro server contol tag itself, regardless of whether these map to properties defined on the Macro in the Umbraco UI, so if you don&#8217;t actually need to know the value of the QueryString parameter, you can just define the attribute on the Macro server control tag, and not define it as an actual parameter for the Macro, and it will still work.</p>
<p>So there we have it, how to cache a Macro by QueryString parameter.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mattbrailsford.wordpress.com/518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mattbrailsford.wordpress.com/518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mattbrailsford.wordpress.com/518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mattbrailsford.wordpress.com/518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mattbrailsford.wordpress.com/518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mattbrailsford.wordpress.com/518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mattbrailsford.wordpress.com/518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mattbrailsford.wordpress.com/518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mattbrailsford.wordpress.com/518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mattbrailsford.wordpress.com/518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mattbrailsford.wordpress.com/518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mattbrailsford.wordpress.com/518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mattbrailsford.wordpress.com/518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mattbrailsford.wordpress.com/518/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mattbrailsford.com&#038;blog=5220074&#038;post=518&#038;subd=mattbrailsford&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mattbrailsford.com/2011/02/01/caching-an-umbraco-macro-by-querystring-parameter/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/34b41f8815601e9a16baa4e56c69bcc2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mattbrailsford</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/11/cache1.jpg" medium="image">
			<media:title type="html">cache</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/11/cache21.jpg" medium="image">
			<media:title type="html">cache2</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/11/cache3.jpg" medium="image">
			<media:title type="html">cache3</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/11/cache4.jpg" medium="image">
			<media:title type="html">cache4</media:title>
		</media:content>

		<media:content url="http://mattbrailsford.files.wordpress.com/2010/11/cache5.jpg" medium="image">
			<media:title type="html">cache5</media:title>
		</media:content>
	</item>
	</channel>
</rss>
