FlowRouter is more modular compared to Iron Router.
meteor add kadira:flow-router
In particular, you must manually add a layout rendering package to link with your rendering engine:
meteor add kadira:blaze-layout
meteor add kadira:react-layout
Then you can render through dynamic templating (in the case of Blaze):
<template name="mainLayout">
{{> Template.dynamic template=area}}
</template>
FlowRouter.route('/blog/:postId', {
action: function (params) {
BlazeLayout.render("mainLayout", {
area: "blog"
});
}
});
The parameters are specified on the route, like with Iron Router:
FlowRouter.route("/blog/:catId/:postId", {
name: "blogPostRoute",
action: function (params) {
//...
}
})
But the parameters are not passed as data context to the child template. Instead, the child template must read them:
// url: /blog/travel/france?showcomments=yes
var catId = FlowRouter.getParam("catId"); // returns "travel"
var postId = FlowRouter.getParam("postId"); // returns "france"
var color = FlowRouter.getQueryParam("showcomments"); // returns "yes"