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.
-
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.marcvangend– marcvangend2010-03-08 21:16:38 +00:00Commented 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.Chetan– Chetan2010-03-09 00:50:37 +00:00Commented Mar 9, 2010 at 0:50
Add a comment
|
2 Answers
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.
2 Comments
Chris Ridenour
Actually this is a better route but I would change if ($op == 'insert') to if ($node['type'] == 'custom_node_type' && $op == 'insert')
marcvangend
...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.'));
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('');