-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question : How to make "dynamic" parents? #12
Comments
I understand what you are saying. Unfortunately this is currently not supported. I will add this ticket as a feature request. Feel free to contribute if you find a solution for this issue. |
Hey, i know it's been a while, any luck on this? |
@javascriptlove I forked the package and added ability to pass function for the title and parent parameters. Router.route('/invoices/:month', { name: "myInvoices.show", parent: function () { if (Roles.loggedInUserCan("myInvoices.index")) { return "myInvoices.index"; } else { return null; } }, title: function () { var data = this.data(); if (data) { return data.month.format('YYYY-MM'); } else { return ''; } }, waitOn: function () { var user = Meteor.user(); if(user) { return [ subsManager.subscribe('settingsForInvoice'), subsManager.subscribe('expert', user.username) ]; } }, data: function () { var wantedMonth = moment(this.params.month, 'YYYY-MM'); var userId = Meteor.userId(); if (!wantedMonth.isValid()) { return; } if (!wantedMonth.isBefore(moment(), 'M')) { return; } if (userId) { var username = Meteor.users.findOne({_id: userId}, {fields: {username: 1}}).username; if (username) { return { month: wantedMonth, expertUsername: username, }; } } }, action: function () { if (this.data()) { this.render('InvoiceShow'); } else { Router.go("NotFound404"); } } });
|
@monbro - Was this actually merged? |
Hi,
Is it possible to dynamically set the parents instead of simply using their route name?
Let's say we have a collection of documents with a search page, on which the search elements are stored in the query (e.g. /documents/search?s=Some%20keywords). Search results would then be the children of the search route, using simply the search route name, breadcrumbs would look something like this:
But the user, when clicking the "Search" breadcrumb element, would expect to go back to the search results from where he came from.
Would there be any way to pass parameters to the parent (from the "View" route) for it to be "/documents/search?s=Some%20keywords" instead of just "/documents/search" ?
Thanks for this package anyway, it's really useful and simple!
The text was updated successfully, but these errors were encountered: