has iron-router a group function like flow-router

162 Views Asked by At

Hey Ladys and Gentlenerds! ;-)

is there a way to handle my URLs with a prefix or group or something like that?

cooldomain.com/admin
cooldomain.com/admin/posts
cooldomain.com/admin/comments
cooldomain.com/admin/something

Flow-Router Groups

i don't want to remove iron-router... i use iron-cli and iron-controller too.

1

There are 1 best solutions below

0
On BEST ANSWER

One option is to use route parameters and perform an action based on which admin sub page you navigate to.

// cooldomain.com/admin/posts
Router.route('/admin/:page', function () {
  var params = this.params; // { page: "posts" }
  var page = params.page; // "posts"
  // Do something based on page value
});