2

I want to add a custom message once someone saves a specific content-type telling them that it is going through an approval process. This will let them know as well as prevent them from re-submitting.

2
  • What do you mean with 're-submitting'? If you're afraid that simply refreshing the page will submit the form again, don't worry, Drupal has taken care of that. Commented Mar 8, 2010 at 21:16
  • not refreshing. more like the user thinks it hasn't gone through the first time they tried so they fill out the form again and submit. that's what i meant by re-submitting. Commented Mar 9, 2010 at 0:50

2 Answers 2

2

Your best bet is a small custom module that does something like this (completely untested):

<?php
function MODULENAME_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($node->type == 'custom_node_type' && $op == 'insert') {
    drupal_set_message(t('Put your custom message here.'));
  }
}

For more info, see the docs for hook_nodeapi and drupal_set_message

Edited to reflect the below comments.

Sign up to request clarification or add additional context in comments.

2 Comments

Actually this is a better route but I would change if ($op == 'insert') to if ($node['type'] == 'custom_node_type' && $op == 'insert')
...and if your message needs to be translated in different languages, wrap it in the t() function: drupal_set_message(t('Put your custom message here.'));
0

This is difficult to do without a custom module.

One way I would try and do this is to overwrite the post-submit URL.

Then in the new page, use a PHP filter and do the following:

drupal_set_message('The submitted content is being approved');
drupal_goto('');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.