Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I'm trying to use editview to show a list of designations under a parent donation. The amount and fund fields are important, but title is not at all for these nodes. I was hoping autonodetitle would handle it, but it doesn't seem to.
I have a custom code module with this call:
function multi_custom_nodeapi(&$node, $op, $form = NULL, $a4 = NULL) {
if ($node->type == 'designation') {
$node->title = 'designation';
}
}
This, too, does not work. I've tried fiddling with the module weights, but not luck so far.
Has anyone managed to create node titles automatically within editview so far?
EDIT: I set my custom module's title to be -1, and cleared my cache, and now this seems to be working okay. Keep in mind its probably overkill, it would be better to find which $op to fire on and make a call to autonodetitle's appropriate function.
After you install the autonode title module,
find and replace the editview_form_alter function as below.
function editview_form_alter($form_id, &$form) {
// Max add for disable the node title
if (auto_nodetitle_get_setting($form['#node']->type) == AUTO_NODETITLE_ENABLED) {
// we will autogenerate the title later, just hide the title field in the meanwhile
$form['title']['#value'] = 'ant';
$form['title']['#type'] = 'value';
$form['title']['#required'] = FALSE;
}
else if (auto_nodetitle_get_setting($form['#node']->type) == AUTO_NODETITLE_OPTIONAL) {
// we will make the title optional
$form['title']['#required'] = FALSE;
}
if ($form['#base'] == 'editview_node_form') {
$form['submit']['#value'] = t('Update');
if ($form['#node']->nid == '') {
$form['submit']['#value'] = t('Add');
}
}
}
Comments
Comment #1
summit commentedSubscribing, greetings, Martijn
Comment #2
summit commentedSubscribing, greetings, Martijn
Comment #3
gcassie commentedI'm trying to use editview to show a list of designations under a parent donation. The amount and fund fields are important, but title is not at all for these nodes. I was hoping autonodetitle would handle it, but it doesn't seem to.
I have a custom code module with this call:
This, too, does not work. I've tried fiddling with the module weights, but not luck so far.
Has anyone managed to create node titles automatically within editview so far?
EDIT: I set my custom module's title to be -1, and cleared my cache, and now this seems to be working okay. Keep in mind its probably overkill, it would be better to find which $op to fire on and make a call to autonodetitle's appropriate function.
Comment #4
salad commentedAfter you install the autonode title module,
find and replace the editview_form_alter function as below.
Comment #5
agileware commentedThis has now been done in 5.x-1.x-dev.
It will be in the next release soon.
Comment #7
summit commentedHi, and how about the D6 version please?
Thanks a lot in advance for considering this!
Greetings, Martijn
Comment #8
agileware commentedThis has been done in 6.x-1.0-beta1.
The issue was here - #377862: Unable to create nodes with automatic node title