Posted by nilashis on November 3, 2012 at 7:52am
I have a link "Add a Post" (url: /node/add/mypost) which is not directly accessible to users.
I want to display a menu item titled "Add a Post" so that when users click on it, user goes to login page and THEN goes to "/node/add/post"
I have tried using "logintoboggan" and "rules" modules but these redirect user to "node/add/mypost" EVERYTIME a user logs in - I also have a "log in" only link where I just want the user to come back to home page after logging in.
Question Summary: How to have redirect users to a node add form based on a menu item that they clicked on? (menu item here = separate than the "log in" link)
Comments
If you would like the “add a
If you would like the “add a post” link to first direct the user to a login page, then to “node/add/post”, have the “add a post” link direct direct the user to the login page url, with “?destination=node%2Fadd%2Fmypost” appended to the end of it (the %2F is used in place of slashes). The destination parameter designates the location that will routed to after form submission, allowing you to have the same form redirect differently depending on the link used to access it.
@bjnmm - It worked. Thank you
@bjnmnm - It worked. Thank you very much! One note for other folks who may try this... In the link for the menu item, I had to enter the entire URL. What I mean: I had to enter "www.example.com/user/login?destination=node/add/post', just adding "user/login?destination=node/add/post" did not work.
Neil