TypeaheadSearch

From CODECS Dev

...

{{#recon-sitesearch:
|apiurl=
|apiurlparams=
|targeturl=
|footerurl=

|dev=true // Temporary. Set to anything but false to show the API being used and maybe some additional information.
}}

Parameters

apiurl
Base URL of the API from which to fetch the data.
apiurlparams
URL query parameters to add to the base URL. This is a convenience method: put each URL parameter, e.g. action=recon-suggest-entity, on a new line. The URL encoding and ampersands are taken care of for you. Use the final parameter for the user-provided substring.
targeturl
Optional if the wiki being queried is local. If this option is not set, the URL of each search result in the menu offers a direct link to the associated wiki page. It is possible, however, that the page is not necessarily available to the user. You can use this option to instead send the user to an intermediate page, a kind of web proxy, that handles the request, performs some checks and redirects to an appropriate destination. [...] The extension comes with a special page designed for that purpose. See Special:ReconDirect.
footerurl
Optional if the wiki being queried is local. The bottom item in the menu, or footer, is reserved for a link to a query page with the provided phrase. When nothing is set, it is assumed that you are happy to send users to MediaWiki’s general full-text search page (Special:Search, .../Special:Search?fulltext=1). Set it to a different URL of your choice as long as as the final parameter is used to take the phrase provided.

Define your target URLs

@todo You can send the user to the target page directly, which is fine if you know that the page can be accessed. or to an intermediate special page that runs a couple of checks


Development

Tests: https://dev.vanhamel.nl/ReconciliationFront/Sitesearch

For consideration:

|placeholder=Placeholder text, e.g. Search the website.
|showthumbnail=boolean
|newwindow=false (default) or true // open link in same or new window when clicked. Cf. _blank or _new
or |target=_blank or _new (open page in same or new window)