Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8220505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:32:28+00:00 2026-06-07T13:32:28+00:00

I have a product block in a template like this : <script type=text/x-handlebars-template id=tmpl-person>

  • 0

I have a product block in a template like this :

<script type="text/x-handlebars-template" id="tmpl-person">
    <div class="product">
       <!-- Product details here -->
    </div>
</script>

What I want to do is if from the array of person I get as data , after every three persons , I want to insert a container called <div class="row-fluid"></div> and three persons inside it.. then a row-fluid container and three persons inside it. How can I achieve this using helpers ? Thanks for help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:32:30+00:00Added an answer on June 7, 2026 at 1:32 pm

    You could use something like this

    Handlebars.registerHelper('each', function(context, block) {
      var ret = "";
    
      for(var i=0, j=context.length; i<j; i++) {
        ret = ret + "<li>" + block(context[i]) + "</li>";
      }
    
    if( i % 3 == 0)
       ret = ret + <div class="row-fluid"></div>
    
      return ret;
    });
    

    And you could define your custom iterator like following

    <script type="text/x-handlebars-template" id="tmpl-person">
        {{#each productInfo}}
        <div class="product">
           <!-- Product details here -->
        </div>
        {{/each}}
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have created a list_home.phtml that i call from {{block type=catalog/product_list category_id=6 template=catalog/product/list_home.phtml}} The
Hi I have assign 12 product to category Phone(id=12), and {{block type=catalog/product_list category_id=12 template=catalog/product/list2.phtml}}
I have a static block that have 2 product list template in it {{block
I have this xml <products> <product> <name>Demo</name> </product> <product> <name>Black Beauty III</name> <description>Beautiful les
I have product item webpages located in /product/items/*.html?id=12345&ref=54321 and I would like the webpages
Does anyone have an example of making the product details of the SammyJS json
I have a custom block (tabbed product info) which I want to display in
I have a static block called newest_product (with content) and I would like to
I have an ajax request that looks like this, $(#frmProducts).submit(function(){ var dataSet = $(#frmProducts).serialize();
<div id='main'> <fieldset> <legend>Feed</legend> <div class='user_show_finds'> <span> <h3> product name </h3> <p> <a href=/products/1>Thorpe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.