Hi, I have a block with node/add/page in it that is visible on numerous pages. When I use the form block to create the new page, the default drupal action is to display the new node. Instead, I'd like to simply refresh the page that contained the formblock. However, since the formblock is on numerous pages, I can't set a hard-coded
$form_state['redirect'] = 'some-page';
option in function MYMODULE_submit
any suggestions would be welcomed.

Thanks,
Dean

Comments

Courtney.B’s picture

You could potentially use Rules in conjunction with Rules Support Forms to achieve what you're talking about.

visuaLatte’s picture

You could use Rules, probably even without the Rules Support Forms module. A rule could potentially be set up like this:

Event: creating a new node
Condition: Content is of type [...]
Action: Page redirect to /node/[nid]

praveenneelu’s picture

Issue summary: View changes

Your use case is "Redirect users to a different page upon viewing or submitting a form." It is available as a Feature of Rules Forms Support module in Drupal 7 to generate the action when events get triggered.