title: handlebars partial context
body: <p>I have an array that contains the information for social buttons (href,alt,img). I created a partial that would cycle through the array and add the objects, here is what I have.</p>
  
  <p>the array:</p>
  
  <pre><code>var social=[
      {
  
          "url":"http://twitter.com/share?text="+encodeURIComponent(this.title)+" "+encodeURIComponent('#grnsrve')+"&amp;url="+domain+"&amp;via="+twitterAcct,
          "image":"IMG/media/twitter_16.png",
          "alt":"twitter link"
      },
      {
          "url":"http://twitter.com/share?text="+encodeURIComponent(this.title)+" "+encodeURIComponent('#grnsrve')+"&amp;url="+domain+"&amp;via="+twitterAcct,
          "image":"IMG/media/twitter_16.png",
          "alt":"twitter link"
      },
      {
          "url":"http://twitter.com/share?text="+encodeURIComponent(this.title)+" "+encodeURIComponent('#grnsrve')+"&amp;url="+domain+"&amp;via="+twitterAcct,
          "image":"IMG/media/twitter_16.png",
          "alt":"twitter link"
      }
  ];
  </code></pre>
  
  <p>The template:</p>
  
  <pre><code>social_partial = '&lt;a href="{{url}}" alt="{{alt}}"&gt;&lt;img src="{{image}}"/&gt;&lt;/a&gt;';
  </code></pre>
  
  <p>The partial function:</p>
  
  <pre><code>Handlebars.registerPartial('addSocial',social_partial);
  </code></pre>
  
  <p>and the main template:</p>
  
  <pre><code>&lt;div class="tip_social"&gt;
      {{&gt;addSocial social}}
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm getting a 'Depth0 is undefined error'. I tried looking for documentation on parials getting a different context , but I have yet to find it.</p>
  
  <p><strong>edit</strong> <a href="http://jsfiddle.net/EjywE/" rel="nofollow">here</a> is a more complete fiddle of it</p>