drupal_add_js
Drupal 6.只有在创建特定时才执行的正确方法content_type
是什么?
我有一些 jQuery 代码只需要执行来控制特定 content_type 创建中的一些表单元素。
我已经有一个模块,它的名称与 content_type 不同。这是一个问题吗?我还能挂在表格上吗?如果是这样,生成特定钩子的正确方法是node/add/content_type
什么?
编辑:这仅用于创建,而不是视图。
编辑2:目前不工作的代码:文件:testmod.module
function testmod_form_node_type_form_alter(&$form, &$form_state) {
if ($form['#node_type']->type == 'testnode') {
drupal_add_js(drupal_get_path('module', 'testmod') . '/new_msg.js');
}
}