Displaying parts of a collection in separate areas


#1

I’m not sure how i can display a collection with some elements in one box and others in another box… I’m trying to represent decks of flashcards and display the current cards on one side and the candidates on the other side.


#2

i created an image showing what im trying to do http://i.imgur.com/bJI1EfU.png


#3

Just create two templates for your needs and move forward the data source

<template name="master">
    {{> leftdeck docs=my_col}}
    {{> rightdeck docs=my_col}}
</template>

<template name="leftdeck">
    {{#each docs}}
        ...
    {{/each}}
</template>

same with rightdeck

Then just export the helper

Template.master.helpers({
    my_col: function() {
        return MyCollection.find();
    }
}

Hopefully this gives you a starting point

Tom


#4

Oh wow, yeah, I think i see where i messed up now, thanks


#5

I’m unsure of how to do this with the FlowRouter using FlowLayout… it seems like i’m still missing something. Does anyone know of an example i could look at?


#6

i’m missing something obvious in this code here


#7

for future reference do not forget {{> template}} if you typo {{template}} you’re gonna have a bad time and not see it for an hour mmmmk?