开发者

Drupal 7 autocomplete_path function return hidden values

开发者 https://www.devze.com 2023-02-07 12:07 出处:网络
For a Drupal 7 module I\'m working on, I would like the autocomplete_path return function for a textfield to (开发者_JAVA百科in any way decently possible) pass additional information back to the hook_

For a Drupal 7 module I'm working on, I would like the autocomplete_path return function for a textfield to (开发者_JAVA百科in any way decently possible) pass additional information back to the hook_form function it was called from.

If including the additional info in the return (which i'm pretty sure) is not possible, is there a way to define variables in a scope to make this work decently?

The reason for this is that I'm getting the auto complete info via querying another site for musical information and returning "artist - song" but would like the function to also return album name, album image (link), etc.

Any help is appreciated.

Thanks!

EDIT: As of right now I believe there is no perfect answer but a couple of decent suggestions are available on the Drupal forums here.


Short answer is that is beyond the simple capabilities of the autocompletion callbacks in core. You'll want to look into rolling your own solution with the improved AJAX framework in Drupal 7. See http://d7.drupalexamples.info/examples/ajax_example for what is possible with minimal code.

0

精彩评论

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

关注公众号