开发者

Invoking a CCK widget in a custom module

I'm trying to find a good example or tutorial of how to include a content_taxonomy_autocomplete field within a custom Drupal module?开发者_运维知识库 I haven't found anything like it... I've found some that show how to create one for a custom module, but as the field already exists, I just want to reuse it in my custom module, but can't seem to find anything on how to use that field in a custom module? If someone can point me to something that would work, that'd be great...


It's possible to reuse CCK widgets in custom forms. But building an autocompleting taxonomy field yourself is really simple. You only need a textfield with #autocomplete_path in your $form, a callback for this path defined in hook_menu() and the callback itself. http://drupal.org/node/42552 is oudated. Search for "Drupal 6 autocomplete". There are loads of tutorials like this.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜