开发者

Add custom message in Drupal

开发者 https://www.devze.com 2022-12-22 19:18 出处:网络
I want to add a custom message once someone saves a specific content-ty开发者_运维问答pe telling them that it is going through an approval process. This will let them know as well as prevent them from

I want to add a custom message once someone saves a specific content-ty开发者_运维问答pe telling them that it is going through an approval process. This will let them know as well as prevent them from re-submitting.


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.


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('');
0

精彩评论

暂无评论...
验证码 换一张
取 消