I have a Drupal view that displays vacation leaves for a particular employee.
I want to have a button or link right on this view that says ‘Add Vacation Leave’. When this button/link is clicked, I want the create content form for Vacation Leave to be displayed with the employee’s name already filled in.
When ‘Save’ is clicked, I would like to go right back to the view, with my new content added. Is all of this possible?
Thanks,
Paul
You can do this without much trouble.
To add the link, you could make a custom template for the view where you add the link. It will be the same for all users, something like,
node/node_type/add. You should make the link with thel()function, and remember to add the destination to where they should be redirected back to. You should get a url like this:/node/node_type/add&destination=/url/to/current/page(the / being escaped ofcause).With destination being set, the default node form, should take care of everything and redirect the user back to the url he came from.