Adding the quick search form / input to a page is relatively easy:
{{velocity}}
#set ($output = $xwiki.getDocument('XWiki.QuickSearchUIX').get('content'))
$output.replace('<li>', '').replace('</li>', '').replace('globalsearch-close', '')
{{/velocity}}
plus some CSS tweaking. The issue is with getting search suggestions and the problem is that currently searchSuggest.js
is enhancing only one input (the one from the top bar). It needs to be changed in order to make it enhance multiple inputs. Something like:
--- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/search/searchSuggest.js
+++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/search/searchSuggest.js
@@ -229,7 +229,9 @@ var XWiki = (function (XWiki) {
#end
*/
var sources = $jsontool.serialize($sources);
- new XWiki.SearchSuggest($('headerglobalsearchinput'), sources);
+ $$('#headerglobalsearchinput, .search-suggest').forEach(function(input) {
+ new XWiki.SearchSuggest(input, sources);
+ });
return true;
};