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

  • Home
  • SEARCH
  • 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 9214875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:04:16+00:00 2026-06-18T02:04:16+00:00

I’m newbie at meteor and have one big misunderstanding how templates working with data

  • 0

I’m newbie at meteor and have one big misunderstanding how templates working with data reflection.
For example I have some data in database like this:

{name: {firstName: "foo",
lastName: "bar"},
father: "buz"}

the way I can reflect it is really scary for me. I can reflect it only like this:

Js:

var Products = new Meteor.Collection("Products");

if (Meteor.isClient) {
  Template.DataTry.dataTryArr = function(){
     return DataTry.find({father: "buz"});
  };
}

html:

<head><title>...</title></head>
<body>{{>DataTry}}</body>
<template name="DataTry">
  {{#each dataTryArr}}
    <p>Mr. {{father}} has a son {{name.firstName}}. They are both {{name.lastName}}</p>
  {{/each}}
</template>

It is working and reflecting. But I can not understand that {{#each}} and why i need dataTryArr in all! is is not working w/o dataTryArr, {{#if dataTryArr}}, Template.DataTry = function(){...} etc. in all it is not working any way w/o {{#each}} (what to iterate there?!)

Please, help me to understand how to reflect simple data like this way

<head><title>...</title></head>
<body>{{>DataTry}}</body>
<template name="DataTry">
    <p>Mr. {{father}} has a son {{name.firstName}}. They are both {{name.lastName}}</p>
</template>

Thanks in advance

  • 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-18T02:04:17+00:00Added an answer on June 18, 2026 at 2:04 am

    You must use either {{#each}} or {{#with}} block helpers to iterate over the values returned from the template helpers.

    If your template helper returns bunch of data from the collection, you might need the {{#each}} iterator, in order to render the returned values in DOM. And if the template helper returns single object, in that case {{#with}} block can be used.

    And you have suggested this:

    <body>{{>DataTry}}</body>
    <template name="DataTry">
        <p>Mr. {{father}} has a son {{name.firstName}}. They are both {{name.lastName}}</p>
    </template>
    

    This will not work in any way, you shuold enclose the <p> ... </p> within {{#each}} block if the Template.DataTry.dataTryArr() returns array of objects.

    <template name="DataTry">
      {{#each dataTryArr}}
        <p>Mr. {{father}} has a son {{name.firstName}}. They are both {{name.lastName}}</p>
      {{/each}}
    </template>
    

    In simple words, {{#each dataTryArr}} will call the dataTryArr method and will iterate over the values returned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have an array which has BIG numbers and small numbers in it. I
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,

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.