First auxiliary register, for example showHr
Handlebars.registerHelper("showHr", function(index_count,block) { if(parseInt(index_count)%3=== 0){ return block.fn(this);} });
Now in the template
{{#showHr @index}} <hr/> {{/showHr}}
Or, if you want, you can write a general helper, contact http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/
Change comment.
Handlebars.registerHelper("moduloIf", function(index_count,mod,block) { if(parseInt(index_count)%(mod)=== 0){ return block.fn(this);} });
Given the start of the index from 0
// If index is 0 open div // if index is 3 means open a div {{
source share