And then add the flow-router-helpers package and subscribe to the post with
Template.postPage.onCreated(function() {
// Subscribe only the relevant subscription to this page
var self = this;
self.autorun(function() { // Stops all current subscriptions
var postId = FlowRouter.getParam('id'); // Get the collection id from the route parameter
self.subscribe('postPage', postId); // Subscribe to the single entry in the collection with the route params id
});
});
and then on the helper to get the details of this specific post:
Template.postPage.helpers({
post: function() {
var postId = FlowRouter.getParam('id');
var thisPostDetails = Spots.find({ // Get the selected entry data from the collection with the given id.
id: postId
}) || {};
return thisPostDetails;
},
});