Search gadget on dashboard

Hello everybody!

I’m looking for a search gadget for my dashboard, but could’t find anythink. I tried to include the search page via the include gadget/macro in page, but this dosn’t work.

Is there a way to achieve this?

Or, at least, how can I set the Search page as a wiki start page?

thank you very much,
all the best

Vince

Hey!

I found a solution, but also a BUG, probabely in xwiki.

The solution was to show the source code of the search page and copy it in a new blank page.

Here the code:

{{include reference="XWiki.SearchCode"/}}
{{velocity}}
## If no Search UI Extension exist then don't display the Search page.
#if ("$!searchPage" != '')
{{include reference="$searchPage"/}}
#else
## Display a message explaining that there's no Search UI Extension.
$services.localization.render('search.page.noimplementation')
#end
{{/velocity}}

THE BUG: As soon as this code saved and the page is shown on the screen (could be as a page, as a gadget in a dashboard, etc), the page is not editable anymore!

Clicking on edit don’t show the WYSIWYG editor anymore, so it is not possible anymore to remove the code. Deleting the page is then the only option possible.

I hope I can help,

all the best,

Vince

Hi, this is actually a known issue. There’s a redirect in the page you’re including.

See Loading...

hello vincent!

thank you for your reply. what would you suggest, how can I include a search bar on my main page? is there a workaround available i.e. a macro, a gadget, whatever?

thank you in advance,
vince

Check the Panels.Search panel. Basically you just need an HTML form that submits to $xwiki.getURL('Main.Search') and that contains a text input with name text.

{{velocity}}
{{html clean="false"}}
<form action="$xwiki.getURL('Main.Search')">
  <input type="text" name="text" />
</form>
{{/html}}
{{/velocity}}

Hey mflorea,

thank you very much, that works great!

just a little question: The magnifier icon is not showing up, how can I get it?
And, is there a way to expand the search bar to the whole screen.
And, last question, how can I put a suggestion text in it like “search for pages”?

Thank you very much!

Vince