Wednesday 15 May 2013

How can I redirect a Drupal user after they create new content -


I want to redirect my users after making a piece of new material, giving them instructions on the 'View' page Content instead

I've seen mention of hook-lalter or something, but I'm actually new to Doppla, and it's also not sure what it means.

Thank you!

As you mention that you are new to Drupal, I suggest taking a look at it Had given. You can add a trigger to content / saved / updated and add an action to redirect the user to a specific page.

You can still use such a Form_lighter hook in a light weight custom module.

First of all, find form form ID. For node forms, this is [node-type] _node_form. Again, when the form is submitted, you can add new submit function to be executed. Submit the handler in it, set the redirect path.

See your module code will be like Bellez:

  & lt ;? Php function mymodule_mytype_node_form_alter (& amp; $ form, & amp; $ form_state) {$ form ['# submit'] [] = 'mymodule_node_submit_do_redirect'; } Function mymodule_node_submit_do_redirect ($ form, and $ form_state) {$ form_state ['redirect'] = 'my_custom_destination'; }   

The URL of the node form has a very straightforward approach to determining the destination, for example, if you have http://example.com/node/add/mytype ? Destination = my_custom_destination , you will be redirected to that URL instead of the node view page

No comments:

Post a Comment