0

I just made the change to Flow Router and trying to understand it. I'm creating a portfolio. I have a list of portfolio items. You can click a single item and it will take you to the specific page. I have the path helper set up, but the client side publishing seems to be the issue.

This is the helper I have:

Template.Single.helpers({
    portfolio: () => {
        var itemId = FlowRouter.getParam('id');
        return Portfolio.findOne({_id: id});
    }
});

and the route:

FlowRouter.route('/portfolio/:_id', {
    action() {
        BlazeLayout.render('MasterLayout', {content: 'Single'});
    }
});
  • Can you elaborate on what you mean by *client-side publishing seems to be the issue?* Publications are server-side. Subscriptions are client-side. Is your server publishing the required document and is your client subscribing to that publication? – Michel Floyd Oct 08 '15 at 00:55
  • Sorry miscommunication. Basically my issue is when I goto http://localhost:3000/portfolio/HFqizKAWDq5X5ZmQr for example. No information is being showed. I've published the collection and subscribed globally. The only issue seems to be the template helper. @MichelFloyd – Dillon Raphael Oct 08 '15 at 01:25
  • @DillonRaphael I think the ES6 function is the problem change it to regular JS function. –  Oct 08 '15 at 03:59
  • 2
    There's a typo in your helper. It should be Portfolio.findOne({_id: itemId}) – Jeremy S. Oct 08 '15 at 04:03
  • @JeremyS. Would you mind copying that comment into an answer? That way, it can be accepted if it is correct. – Gaelan Oct 08 '15 at 05:03

0 Answers0