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 9193421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:09:32+00:00 2026-06-17T21:09:32+00:00

I´m working on a meteor example. I get the value of one tag on

  • 0

I´m working on a meteor example. I get the value of one tag on click event on the link. That value is the same that is present on one collection inside doc “pet” or “zoo”. I want to use this value to filter the content present on the template.

A minimal example:

    {{#each Animal}}
        <div>
          <span> {{pet}} </span> 
        </div>
        <div>
          <span> {{zoo}} </span> 
        </div>
    {{/each}}

After click:

{{#each Animal}}
        <div>
          <span> {{zoo}} </span> 
        </div>
    {{/each}}

On this case when I get the value present in “zoo” I just want to update the template with all the the spans that contains elements on doc zoo, and that all related to pet dissappear.

The query to mongodb is working perfectly, my problem is that I´m a little bit confused.

Should I use helpers?

Thank you so much.

  • 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-17T21:09:33+00:00Added an answer on June 17, 2026 at 9:09 pm

    Let’s see if I understood correctly your problem.

    You should use a Session variable where you store the action you are doing. Then add a template if and print inside of this tag whatever you want to show at that time.

    Let’s do a minimal example:

    <template name="showAnimalsTemplate">
       {{if showAnimals}}
       {{#each Animal}}
          <div>
            <span> {{pet}} </span> 
          </div>
          <div>
            <span> {{zoo}} </span> 
          </div>
       {{/each}}
       {{/if}}
       {{if showZoo}}
       {{#each Animal}}
          <div>
            <span> {{zoo}} </span> 
          </div>
       {{/each}}
       {{/if}}
    

    Following this example, you add in the client javascript something like this:

     Template.showAnimalsTemplate.showAnimals = function(){
         if( Session.get('action') == 'showingTheZoo')
               return true;
         return false;
     }
    
     Template.showAnimalsTemplate.showZoo = function(){
         if( Session.get('action') == 'showingTheZoo')
               return true;
         return false;
     }
    

    Don’t forget to set the session value inside the click event.

    Session.set('action', 'showingTheZoo');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just found out that after upgrading to Meteor 0.5.2 (from 0.5) event handling
I'm newbie at meteor and have one big misunderstanding how templates working with data
Im working with the Meteor framework and came by this error when I tried
Working with an undisclosed API, I found a function that can set the number
Working with H2 I get this error when I try to write a row
I've got a set of regex's within a function that are working rather well
I want to modify this code so that the value is a variable and
Working on my first EmberJS app. The entire app requires that a user be
Working in Java FX 2.2. The Scene has a horizontal width that is fixed
I have Jquery Mobile working and have found the best way to get it

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.