Jquery Freebase
toemaz - November 16, 2008 - 15:59
This module offers module developers to add the Freebase Suggest functionality to form text fields.
Requirements
Installation
- Copy the 'jquery_freebase' module directory in to your Drupal sites/all/modules directory as usual
- Download the jquery.freebase.suggest package from http://code.google.com/p/freebase-suggest
Check your Drupal jquery version for compactibility - Extract jquery.freebase.suggest package in the jquery_freebase module directory
- Change the name of package folder (e.g. jquery.freebase.suggest-0.4) to jquery.freebase.suggest
- Download, install and enable the Drupal jq module http://drupal.org/project/jq
- Enable jq & jquery_freebase under admin/build/modules
- Check on admin/settings/jq whether you see the freebase plugin
Usage
This module does nothing from itself. It offers other modules who implement forms to add Freebase suggest to it.
Examples can be found on the freebase suggest website as well as in the examples delivered within the package.
Example code:
<?php
if (module_exists('jquery_freebase')) {
jq_add('freebase');
drupal_add_js(
"$(document).ready(function() {
$('#edit-artist').freebaseSuggest( {ac_param:{type:'/music/artist'}} );
$('#edit-track').freebaseSuggest( {ac_param:{type:'/music/track'}} );
});
",
'inline'
);
}
?>