Add auto completion to search fields and any text input field you like.
In the Search Auto Completion panel choose Google's auto completion and/or create a stock of your own auto completion values. While a user is typing into the input field, she/he will be offered a list of words and phrase out of the stock to complete the typing.
If you choose to use Google's and your own values, the add-on will first look into your stock and than complement the list with Google's values up to a total of 20 auto completion values.
To create your own auto completion stock you can choose if it should be build out of
- the Names of all pages
- the Meta-Titles of all pages
- the Meta-Keywords of all pages
- the Page-Tags of all pages
or you enter additional words and phrases in the textfield. Just seperate them by comma.
If you would like to restrict an entry to a specific language (on multilingual sites), put the language code in brackets behind the entry. The same principle applies to page names, meta-titles, meta-keywords and page-tags. You find an overview of all possible language codes in the dropdown below the textfield.
To figure out the language of the currently viewed page the add-on is checking if the Internationalization add-on is installed and if it can take the language from there. If this is not the case, it tries to read the localisation setup of concrete5. As last attempt it reads the localisation setup of the user's browser. If everything fails, the add-on assumes the page is in english.
The add-on is also tracking all values your users are typing into the auto completion input fields (How to define auto completion input fields?). The values are presented in a list ordered by the frequency of their occurence, so that you can easily see what your site users are most interested in. You can select any of these inputs to be added to your stock of auto completion values or just define how many of the most used phrases should be added automaticly.
Note: It is possible that not all inputs get tracked but the majority will.
To make sure that no inputs get added which include terms you don't want to, you can define a black list of terms which disqualify inputs to be used in the automated top list. Seperate the terms by comma. A space character in front or back of the term indicates that the term has to be at the beginning or end of the input phrase. Otherwise the term just needs to be somewhere in the phrase to disqualify the phrase.
Since the tracking of the users' inputs is case insensitive only the typing of the user who used the input phrase first is saved. That might result in a wrong capitalization of the phrase. Therefore you have the possibility to correct the capitalization and only the capitalization. You can not change the input phrase. To define your own words and phrases use the textfield at the top of the panel.
You have also the possibility to restrict the phrase to a specific language for the use on multi-language sites.
Another choice you have is how many characters are needed to be entered before the auto completion starts. This value also defines whether the stock values will be stored inside the page's html code, which allows for a fast reaction time but results in a higher page load, or if they will be retrieved by ajax calls. If set to "0", all values will be stored in the HTML code of the page. If set to a number other than "0", ajax calls will be used.
If Google's auto completion is enabled, the setting "0" will be treated as a "1" and the values will not be stored localy.
The last option is "Instant submit". If checked, the search phrase gets submited instantly after it got choosen out of the auto completion list. If not checked, the phrase gets only put into the text field and the user has still the chance to alter the phrase before submiting it.
You'll find the panel to manage the "Search Auto Completion" add-on in the dashboard under the section "Stacks & Blocks".
Auto completion gets added to the search field of the standard search block by default. So, you don't need to do anything if that is what you are looking for.
If you want to append auto completion to a different text input field, just add the css class "dm-autocompletion" to the input tag. All text input fields with the class "dm-autocompletion" will get auto completion.
If you want to define your own css selectors which mark the auto completion input tags, add the site constant AUTO_COMPLETION_CSS_SELECTORS to the concrete5 config file config/site.php.
E.g., define('AUTO_COMPLETION_CSS_SELECTORS', '.my-class, #some-id');
For styling the auto completion drop box, modify the file packages/search_auto_completion/css/search_auto_completion.css.
If you're just looking for Google's auto completion functionality, the Google Auto Completion add-on might be more interesting for you.