title: Change buttons on fancybox button helper if one image
body: <p>Edit: Here is a <a href="http://jsfiddle.net/1f5uqgb9/16/" rel="nofollow">jsfiddle</a>. I'm trying to get the second image (bird) to only show Toggle and Close on the button helper since it only has one image in the gallery.</p>
  
  <p>I'm trying to remove the Prev, Play and Forward buttons on the button helper if there is only one image.</p>
  
  <pre><code>$(document).ready(function() {
      $('.fancybox-buttons').fancybox({
          helpers: {
              buttons: {
                  if (this.group.length == 1) {
                      tpl: '&lt;div id="fancybox-buttons"&gt;&lt;ul style="width:74px"&gt;&lt;li&gt;&lt;a class="btnToggle" title="Toggle size" href="javascript:;"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="btnClose" title="Close" href="javascript:;"&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;',
                  } else {
                      tpl: '&lt;div id="fancybox-buttons"&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="btnPrev" title="Previous"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="btnPlay" title="Start slideshow"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="btnNext" title="Next"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="btnToggle" title="Toggle size"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="btnClose" title="Close"&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;',
                  }
              },
          },
      });
  });
  </code></pre>
  
  <p>Clearly I have no idea what I am doing. This gives me a "SyntaxError: missing formal parameter" on the 'if (this.group.length == 1)' line. Does anyone have any suggestions?</p>