title: How do I make a template conditional based on a collection's size?
body: <p>I want to do something like this:</p>
  
  <pre><code>&lt;template name="list"&gt;
    &lt;ul&gt;
    {{#if items}}
        {{#each items}}
          &lt;li&gt;{{itemContents}}&lt;/li&gt;
        {{/each}}
    {{else}}
      &lt;li class="placeholder"&gt;There are no items in this list.&lt;/li&gt;
    {{/if}}
    &lt;ul&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>where <code>items</code> is a Meteor.cursor:</p>
  
  <pre><code>Template.list.items = function() {
    return Items.find();
  };
  </code></pre>
  
  <p>However, the code above doesn't work, as the conditional will evaluate positively even if there are no items (which is mildly surprising because Handlebars evaluates <code>[]</code> as falsey). I tried changing the condition to</p>
  
  <pre><code>{{#if items.count}}
  </code></pre>
  
  <p>but then I get the cryptic error</p>
  
  <pre><code>Unknown helper 'items'
  </code></pre>
  
  <p>So, is there a way to write such a condition within a meteor Handlebars template?</p>