I have created the routes and the patFor to be able to reach mysite.com/post/id but instead of opening it in a new page I want this to be opened inside a modal and can’t find how to do it with blaze and flow-router
The current way I link to the postId page is with the meteor add arillo:flow-router-helpers package:
<a href="{{pathFor '/post/:id' id=_id}}">Link to post</a>
but this will take me to my singlePost blaze template…I want that template to be opened in a modal instead of being a new page…so I changed that to :
You could return the post._id in a session variable and return it using a helper function.
The return could be placed in your href, which would call a new modal.
Thanks! I got the same answer on stackoverflow but still couldn’t understand it much, could you provide some example to get me going on that? I am not sure how to return the specific post._id each time
One problem that you may run into (as I did) is that you may have to look at redefining your pub/sub, making the data accessible onclick, rather than on a route load, as this solution assumes you have access to the entirety of the collection/sub in question…
Also, this package is what I use to pass the params to the modal…
This worked perfectly! , I have only one sub to all the collection so it worked out of the gate based on your code, spent all day trying to figure this one out lol, thanks