The site that I'm designing right now has a user dashboard that they see when they login. That dashboard will be at
http://www.domain.com/dashboard
The dashboard is exposed through a module using the _menu callback. But I need each users dashboard to be viewed by other people. Initially I thought I would start all of my paths off with the username. So that it would be
http://www.domain.com/nathanpalmer/dashboard
But I can't see a way to do this with a _menu call back. Outside of drupal I could simply parse the path and pull the correct information that way. I don't want to has the dashboard be a node because none of the content is static (there is no title and body.) It's all dynamically created.
Any ideas? I guess on the _menu callback I could query the user database and add to my array an item for each user. But then how do I pass a username or user id variable into my callback function?
Any ideas?
Thanks,
Nathan
Comments
Switch the path order
Besides switching the path order I would use user id. So the path would be http://www.domain.com/dashboard/{user_id} where {user_id} is a number. The callback would only be 'dashboard' and the callback function would expect an argument, something like
Thanks for the reply. We
Thanks for the reply. We discussed reversing the order but there are a lot of paths that will be related to each user so it made more sense to start out with the user. I've been playing around with this a little bit and it looks like I can split the url and create the menu item only when it's called and it's a valid user like this.