Vous êtes ici

Configure forms and suggestions on version 3.x

Vous avez 30 secondes ?
S'abonner au flux d'actualités
Navigate to Search Autocomplete admin page :
- For D6 at : admin/settings/search_autocomplete
- For D7 at : admin/config/search/search_autocomplete.
Click on the configure link of the form you wish to configure.
You are now redirected to admin/config/search/search_autocomplete/3/configure. Let's describe the various configuration settings available :
  • HOW
    • Minimum keyword size: The minimal number of character the user should enter in the form before autocompletion starts. (Note: an AJAX request is sent the first time suggestions are needed. For instance when the user enters lor, suggestions such as lorem or lorinum are retrieved using AJAX. If the user then completes with e, only lorem is kept in suggestions but the filtering is done using javascript, no more through the AJAX callback. Suggestions are also cached to limit the number of AJAX calls.)
    • Number of search results: The number of suggestions you wish to be displayed during autocompletion.
    • Behaviour when no suggestions are found: A text to be displayed if the user input does not have any possible corresponding suggestion. This is optional and will not fire if left empty.
    • Auto Submit: If enabled, the form will be submitted automatically as soon as your user choose a suggestion in the popup list. This option simply submit the form but does not alter its behavior. In other words: if used in a search box, a basic drupal search will be made using the suggested text.
    • Auto redirect: If enabled, the user will be directly redirected to the suggestion node he choosed instead of performing a form validation process. Only works if "link" attribute is existing in the suggestion and if "Auto Submit" is enabled.
  • WHAT
    • Suggestion source: Choose the source of suggestions. This can be either a URL callback: external or internal or a static resource.
      • URL callback: this is a URL returning a JSON representing a suggestion. This URL can point to an external service or to an internal URL of your site. You can build such a suggestion list using the view plugin style embedded in this module.
        • On version < 3.1 : the URL should have no trailing slash: ex: http://foobar.fr or autocomplete-nodes. The default embedded view callbacks are : autocomplete-nodes (which suggest node titles), and autocomplete-users (which suggests user names).
        • On version 3.2+ : the URL mush end either with a trailing slash or a filter if external  ex: http://foobar.com/ or http://foobar.com?term=. Views provided callback MUST end with a filter.  The default embedded view callbacks are : autocomplete-nodes?filter= (which suggest node titles), and autocomplete-users?filter= (which suggests user names).
      • Static data: suggestion can also be suggested using a static data list. This should only been used in the rare cases where views is not enough to populate your suggestions. Suggestions must be entered one per line with the syntaxe : "foo => http://bar.com"
    • Select a theme for your suggestions : You can select a different theme for each of your forms. This CSS applies to how suggestion drop-down list will be styled (see below to custom your own theme).
Save configuration. Excepted the advanced options, all your settings have been duplicated to every child forms.
Congratulation, your module is configured!

Custom your own CSS

This documentation need further work, please come back later.
Average: 2 (4 votes)
Vous avez aimé: