如何在NodeReference字段中删除节点ID [nid:n] [英] How remove node ID [nid:n] in NodeReference fields
问题描述
这是与此链接相同的问题:
This is the same question of this link:
根据第一个答案(Grayside),我创建了自己的模块并激活。然后我创建一个新的内容,我看起来在nodereference领域,最后选择它 - >它工作(不出现[nid:n])。
According with the first answer (Grayside) I've created my own module and activated. Then I create a new content, I look sth up in the nodereference field and finally select it -> it works (Doesn't appear the [nid:n]).
但是,当我查看/预览或保存或编辑内容时,[nid:n]再次出现。
But, when I view/preview or save or edit the content, the [nid:n] appears again.
有人可以帮助我吗?
推荐答案
感谢您的答案。
我找到了解决方案。 (至少在我的情况下)
I've found the solution. (At least in my case)
我更改了这个文件的代码:
I change the code of this file:
drupal\modules\cck\cck\modules\\\
odereference.module
drupal\modules\cck\cck\modules\nodereference.module
function nodereference_autocomplete_value($element, $edit = FALSE)
{
...
// $value .= ' [nid:'. $nid .']'; --> Comment this line
return array($field_key => $value);
}
它工作得很好!不出现在任何情况下:不在列表中选择,也不保存,编辑等。
It works very well! Doesn't appear in any case: Not in selected from the list, nor when save, edit, etc.
请问!
这篇关于如何在NodeReference字段中删除节点ID [nid:n]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!