I have two different templates in one route. Both return a number of items from a uniform collection however, when I do
Template.stepOneSelect.onCreated(function() {
var instance = this;
instance.autorun(function() {
var subsciption = instance.subscribe('stepOne');
});
instance.occupations = function() {
return Occupations.find();
}
});
it returns Occupations from the whole route. There isn't a way for me to query the ones I need in one template because I query them on the server with other Collection that I am not subscribed to in that template.
So I need
Template.stepOneSelect.helpers({
stepOneTitles: function () {
return Template.instance().occupations();
}
});
to only return the Occupations from that template and I am getting all the occupations from the route
// MORE INFO
I have two collections, CareerPaths
and Occupations
.
CareerPaths
has fields like occupationOneId
which is an _id
of the Occupation. It would be easy if I had a field in each Occupation that states which step of the CareerPath it is but one Occupation can be in different steps of a CareerPath. So I need to be returning Occupations based on CareerPaths. The route has two sections, one with a list of CareerPaths with a limit (only 10 at a time) and the other section should have ALL the Occupations from the first step of a career path, etc. I haven't found anything in publishComposite
to only return the Children of a publication.