Autocomplete v1.0

Release Notes

Autocomplete tags for ELGG, based on jquery autocomplete plugin.

It helps you to fill tags inputs with automatic suggestions based on your text input (tags are loaded from your site database, if there isn't any tags in your site it won't suggest anything).

It works without any code modification (ideal for "not developers"), just unzip on your mod directory, enable and go!

Customizable via themes, just override the "autocomplete/jquery.autocomplete.css" view with your theme.

If you want to customize the autocomplete options just read the jquery.autocomplete documentation and override the "js/elgg.autocomplete" view.

I hope it will be useful ;)

Enjoy and report feedback please!

UPDATE!:

Fix 1:

autocomplete/views/default/input/tags.php must be fixed to be sure of the autosuggests are loaded on all input tags:

Line 17: if (!$class) $class = "input-tags"; else $class .= " input-tags";

 

Fix 2:

autocomplete/index.php

$threshold = 0; // (must be int) return only tags with more than X repetitions

 

It will be fixed in the next version ;)

Screenshots:

image

http://picasaweb.google.com/lh/photo/NqfOGrtdzDTUY6a5J8a0gQ?feat=directlink

FAQ:

* The autocomplete plugin doesn't show the suggestions correctly: Be careful with your browser cache ;)

Disclamer:

This plugin doesn't have any warranty, I don't offer any support on it.

  • where is the interface to enter the words

  • there is no interface, the suggestions will be loaded directly from your site database (like get_tags function).

  • hi Miguel

    help me...i upload  the autocomplete to the mod dir , i enable  him and now what ? where i can see it in actions ? what i need to do  to try it ?

  • Just try, for example, to write a blog post. In the tags field start writing something, the suggestions must appear below the input box. If you start to write "pl" for example, and there is another object in your site with the tag "player" a suggestion must appear.

    You have a screenshot inside the autocomplete package, if you wanna see the autocomplete jquery plugin working just try the demo

  • thanks miguel its working now :)

    i have  another question ,it is possible to put some tags manual ?

  • You can modify the index.php file and add to the suggess list whatever you want, just keep in mind that all suggests must be in format:

    suggestion\n

    Anyway, i think the best choice is to create some objects with tags. If you don't want those objects to be visible, just make them private.

    Regards!

  • Miguel,

    I placed the plugin in the mod folder and enabled it. I tried it in two places - The Group search by tags area as well as tried to enter the existing tags in the blog post. But in neither of the scenarios the existing tags appear. What could be the problem? I tried in IE, Firefox as well as Chrome.

  • I have tested the plugin on IE6, IE7, Firefox 3, Opera and Safari for windows. It works fine for me.

    The plugin works overriding the view "input/tags", Do you have any plugin overriding the view "input/tags"? Try to put the autocomplete plugin in the last position.

    :)

  • @mfb Check out the update note. I hope it will help you ;)

  • Buenas Miguel, quiero aprovechar tu plugin para que sugiera los tags de los campos del plugin "forms"  unicamente. Es posible? No tengo claro que debo poner en el fichero de configuración. He echo pruebas pero no han resultado.

    //GET INPUT

    $q = get_input('q'); // que tengo que poner aquí? get_tags?

    //$metadata_name = get_input('metadata_name');

     

    //WE HAVE INPUT? GET DATA (CUSTOM CODE LIKE get_tags)

    if ($q){

    //CONFIG

    $threshold = 1; // (must be int) return only tags with X repetitions

    $limit = 0; // (must be int, 0=no limit) return X tags maximum

    $entity_type = "object"; // (object, user, site) I want tags from objects

    $entity_subtype = ""; // Que pongo aquí? form_data? form:field? nada?

    $owner_guid = ""; // Este supongo que lo dejo en blanco

    $site_guid = -1; // I want tags only from the current site

    $metadata_name = 0; // Aqui pongo form_data? nada? otra cosa?

    Grácias.

  • En un principio, y sin ver como es el plugin "forms", debería bastar con hacer que el plugin "forms" utilizara en sus input-tags una clase especial. Por ejemplo "forms-input-tags". Después deberías modificar la vista "js/elgg.autocomplete.php" del plugin "autocomplete" o sobreescribirla desde el plugin "forms" con el  siguiente cambio:

    Original:

    $(".input-tags").each(function(){

    Modificado:

    $(".forms-input-tags").each(function(){

     

    Un saludo!

     

  • Hi,

    I added a lil' piece of code to the index.php file to exclude some metadata subtypes from being suggested, as those were not really user-friendly (eg. moddefaultswidgets metadata subtype).

    If needed, you may add this to your code :

    Add..

        $excluded_subtypes = array('moddefaultwidgets', 'openid_client::association', 'openid_client::nonce', 'dashboard_widget_tab', 'openid_server::trusted_root');  // facyla: define this array if you need to exclude some metadata subtypes (eg. moddefaultswidgets subtype)

    after     $metadata_name = 0; //0 all tags, if you wanna use only a specific metadata_name just put the string

    and :

        // Added by facyla to manually exclude some metadata types (typical ex.: mod default widgets)
        if ($excluded_subtypes) {
        foreach($excluded_subtypes as $excluded_subtype)
          $query .= " AND subtype.subtype <> '$excluded_subtype'";
        }       
    after     $query .= " where msvalue.string != '' ";

  • (sorry, can't delete previous post : wrong URL) => http://elgg.elgg.fr/pg/file/Facyla/read/2011/autocomplete-modifi

     

    I wonder if a white list wouldn't be more useful instead...?

  • the tags input box completely disappers when i enable the plugin ...

  • Hi Miguel

    I modified the two files and copied them over to the mod directory, but in tool administration it does not show up. Any idea's? I'm using elgg1.2

  • it kinda suggests only for a few tag fields is it possible it can be used in messages>compose in the TO field to auto suggest friends names..like in myspace and other sites..

  • yet waiting for an Answer ??

  • Hi Miguel.

    I tried this mod but it seems to break the site wide categories mod (edit categories page comes up blank). Just thought I'd let you know in case you're planning a new version :-)

     

  • HI Miguel and all

    I have tried this plugin and it works BUT its pulling in all kinds of crazy stuff as well. I think its accessing to many things, can i limit what it can pull in so it just pulls in user created tags?

    I have had to turn it off as it was suggesting weird code, file names as well as users tags.  I just wanted users tags, thats all.

    Can anyone help at all? Thanks.

    Great Plug though.

  • How can i add the subtype Tidypics so it can see the tags for the pictures in there??

  • Hello,

    Why your plugin suggest me my elgg directory?

    When I type sometinhg in field, it display this:

    - ElggDiskFilestore,

    - /home2/aussierco/public_html/ut/files/,

    - image/jpeg

    etc..

    How Im gonna fix this?

  • Autocomplete 1.0Autocomplete 1.1Autocomplete 1.2Hi everybody! There is a bug in Autocomplete plugin: it doesn't appear only tags' suggestions below the Tags' line; instead, it appears lots of strings there, like shows this images (respectively from the 1.0, 1.1 and 1.2 versions). Some idea about it? This plugin is potentially awesome... congratulations!
    This bug happens in autocomplete_1.0, autocomplete_1.1 and autocomplete_1.2... the only difference is the suggestions list, but in all the cases they suggests more than only the tags.
    Elgg version: 1.7.1 2010040201
    In all tests the plugin installed was in the bottom position of the Tool Administration list.

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 1907
  • Recommendations: 0

Other Projects

View Miguel Montes's plugins