General Actions:
Log-in
Register
Wiki:
games
▼
:
Document Index
»
Space:
XWiki
▼
:
Document Index
»
Page:
SearchSuggestConfigSheet
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Wiki Home
»
SearchCode
»
Search Suggest Configuration
»
SearchSuggestConfigSheet
Wiki source code of
SearchSuggestConfigSheet
Last modified by
Administrator
on 2011/11/06 20:09
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
{{velocity}} =Search Suggest= #set($searchSuggestConfigClass = $xwiki.getDocument("XWiki.SearchSuggestConfig").xWikiClass) #set($searchSuggestSourceClassname = "XWiki.SearchSuggestSourceClass") #set($configObj = $doc.getObject($doc.fullName)) **$searchSuggestConfigClass.get("activated").prettyName**: $doc.display("activated") == Sources == A suggest source is a URL that takes 3 parameters: query, input and nb. The query parameter must contain a ~_~_INPUT~_~_ placeholder. This URL must process the query with the given user input and return the result in the XML format expected by the suggest component. |= Name |= URL |= Query |= Results Number |= Icon |= Highlight matches |= Activated #foreach($srcObj in $doc.getObjects($searchSuggestSourceClassname))| $doc.display('name', $srcObj) | $doc.display('url', $srcObj) | #if($context.action == 'view') {{{ #end $doc.display('query', $srcObj) #if($context.action == 'view') }}} #end | $doc.display('resultsNumber', $srcObj) | $doc.display('icon', $srcObj) | $doc.display('highlight', $srcObj) | $doc.display('activated', $srcObj) #end #if($context.display == 'edit') [[Add a new source>>$doc.getExternalURL('objectadd', "classname=${searchSuggestSourceClassname}&xredirect=${doc.getURL('inline')}")]] #end {{/velocity}}