Feature #25
Add node to request object
0%
Description
It might be useful to have middleware that provides the current node (if any) as request.node. Occasionally, for example, someone may want to write a view that overrides a certain address but which still references the node at that path.
History
Updated by Joseph Spiros over 13 years ago
Although I'm not immediately aware of a case where I would use this, it seems like something that may be useful to others, or in the future. So, sure. Not even sure if a middleware makes sense, since the request needs to be processed for a node to be found. But then, we could put the node finding into the middleware, make the middleware required, and then use the request.node object in the router view.
Updated by Stephen Burrows over 13 years ago
We could also write the router view to use request.node if available and otherwise use the node-finder.
Updated by Stephen Burrows over 13 years ago
- Status changed from Feedback to In Progress
- Assignee set to Stephen Burrows
This is currently implemented in my node_middleware branch. The commit is currently 01a66d144c3ac6539991c5b9f00e1bd5bab132ee, but I may rebase the work onto ithinksw/master if that is desired.
Updated by Stephen Burrows over 13 years ago
- Status changed from In Progress to Resolved
Merged into ithinksw/master with commit 9592f8df376c7dacacd49bb7587ee494ad339035