I am using Meteor 0.5.2 and trying to solve what seems to me to be an obvious model that should have an easy solution.
I have a template that should return different pieces of data in each instance of the template.
For example, I have a template showing a television program - showing a show.
Then I need to display two instances of the same template with different data - one with past shows and one with upcoming shows.
So, I have a tv program template:
<template name="tv_program"> {{#each shows}} ... </template>
Ideally, I would like to do something like:
{{> tv_program past_shows}} ... {{> tv_program upcoming_shows}}
pass the parameter to the tv_program template instance, which I can read from JavaScript and configure mongo requests.
I have currently copied / pasted my / js template code and adjusted mongo requests, but there should be a better way.
I was looking for partial / helpers with arguments, but this does not seem to solve my problem.
Thank you Vladimir
source share