Aus SubmersWiki
Version vom 12. Dezember 2010, 12:48 Uhr von 127.0.0.1 (Diskussion)
Autocomplete can be used on:
- All the values of a specific property, add autocomplete on property=property-name to the field definition.
- The names of all pages in a category, add autocomplete on category=category-name
- The names of all pages in a namespace, add autocomplete on namespace=namespace-name
If you want use autocomplete based on the values in an external URL, which lets you get autocompletion values from any external system, you should:
- Create a page/web service that takes in a substring via the query string, and displays a set of autocompletion values; the values should be in JSON format, and look like the JSON returned by the MediaWiki API, this also makes it easy to autocomplete on the values from another wiki.
- Decide on a short string to represent this URL.
- Add a line to LocalSettings.php: $sfgAutocompletionURLs['URL-identifier-string'] = 'URL';
- Add the parameter autocomplete from url=URL-identifier-string to the relevant field in the form definition.
- Disable autocompletion, if it's enabled by default for a field, by adding the parameter "no autocomplete" to the field's definition.