Closed JulianKingman closed 8 years ago
For further context, the main reason I want this is for package architecture, where the routes are already declared, and there are certain things I want to do (like render new elements) that should clearly be handled by the router, but for which I'm using really hacky things (like checking the route and rendering different things conditionally, basically making my own router).
I think you can use triggers for this. Instead of extending the action, like you propose, add a trigger for that route.
That seems like a pretty good solution. I'll give that a shot and post back my results.
For reference, here's the way to do it:
FlowRouter.triggers.enter([
function () {
//If you choose to render, also render the things that were already rendered in the original route
BlazeLayout.render('layout', {
main: "example_template",
newZone: 'another_template'
});
console.log('on extended route');
}
], {
only: ["RouteNameGoesHere"]
});
For example, this route from telescope:
Can I add more actions to the route? Something like this would be ideal: