我很难让正文字段至少包含 2000 个字符数。空格。如果字段少于 2000 个字符,则应该无法保存节点。
到目前为止,我有:
<?php
function esund_form_alter(&$form, $form_state, $form_id) {
// Normally a switch is used because you may want to alter more than
// one form and it is easy to add a new case for each form.
if ($form_id == 'forslag_node_form') {
$form['body_field']['body']['#description'] = "Description of the content of the post, which should also indicate what the motivation is to hold the post, and what problem or question topic highlights? The description must min. fill 2,000 characters incl. spaces and max. 4000.";
}
}
function esund_menu_alter(&$items) {
unset($items['node']);
}
我在该主题上使用谷歌搜索找到了以下内容,但是我不知道如何将以下代码集成到上面并进行最小字符数:
<?php
function minimum_words_text_form_alter(&$form, $form_state, $form_id) {
if ($form['#parameters'][0] == 'node_type_form') {
$form['submission']['min_word_count']['#type'] = 'textfield';
unset($form['submission']['min_word_count']['#options']);
}
}
?>
我正在使用 Drupal 6.31
干杯