Seach bar always shown

Hello
Is it possible to make search bar on top always visible? not needing to press search icon to show it.

Hi. There’s no configuration option to always show the search bar that I know of. However, you could add a SSX containing the CSS to make it visible. See https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/SkinExtensionsTutorial/

I tried with JSX to remove globalsearch-close from html but no results…

String.prototype.replaceAll = function(string, replace) {
return this.split(string).join(replace);
};

var str = ā€˜<form class=ā€œnavbar-form globalsearch globalsearch-close form-inlineā€ id=ā€œglobalsearchā€ action=ā€œ/bin/Main/Searchā€ role=ā€œsearchā€>’;
var result = str.replaceAll(ā€˜globalsearch-close’,ā€˜ā€™');
console.log(result);

There’re lots of ways how to approach it. For instance, if you want every load, the search filed to be active (already pressed). You can use simple JS code. Note that it will disappear after you click elsewhere on the page.

window.onload = function () {
  document.querySelector("#globalsearch > button").click();
};

Hi, friends, I’d like to bring this up.

The fact that the search bar is always collapsed and inactive by default in Flamingo themes is inconvenient. New users don’t notice it and can’t use the search. I have to constantly explain and remind them about it. And yet, as surveys show, few people use the search in XWiki.

Previously (in XWiki 15x), I could make the search bar active using CSS, but after upgrading to 17x, this stopped working. Now, even if the bar is always visible, the field itself is inactive and you can’t enter a query until you click the magnifying glass.

nikpetrenko’s solution isn’t good, because we need the search bar to be active at all times. Besides, adding JavaScript isn’t a good idea.

Perhaps this can be configured in the search module itself — shouldn’t this setting be there?

I’d be very grateful for your advises!

The actual Xwiki version 17.4.5.

There’s a search settings section in the administration section.
Perhaps it would be nice to add a search bar display setting? With the ā€œAlways activeā€ option. It looks convenient.

I would like this very much too.

We had a solution until we upgraded from 15.x to 17.x.

We did change XWiki/QuickSearchUIX in two lines

-      globalSearchInput.attr('disabled','');
+      // remove it as we don't use the search button - search input is always visible
+      // globalSearchInput.attr('disabled','');
-        <input type='text' name='text' placeholder="$services.localization.render('panels.search.inputText')" id='headerglobalsearchinput' disabled />
+        <input type='text' name='text' placeholder="$services.localization.render('panels.search.inputText')" id='headerglobalsearchinput'/>

and hid the magnifier with a style sheet extension.

But we had to revert it with 17.x because then it worked the first time but if you unfocus the searchbar and focus it a second time it was a kind of deactivated (as far as I remember).

We would like to have it opened again.

Simpel

Some thoughts on this:

  1. I’m not doubting you, but I don’t understand how users could not notice the search. It’s so common that search bars are located at the top that if they look for a search should will find it for sure. Look at this discourse forum, it does the same thing as XWiki does and plenty of apps do that AFAICS.
  2. The future goal is to offer the Cristal L&F in XWiki and the design page for Cristal shows an expanded search bar, see https://cristal.xwiki.org/xwiki/bin/view/Main/WebHome
  3. You should still be able to control the XWiki search to be expanded by default using a SSX or JSX. See https://www.xwiki.org/xwiki/bin/view/FAQ/How%20to%20customize%20the%20wiki%20header%20search%20field%20to%20be%20centered for example

One additional thought in case someone did not realize: We had a similar requirement when we introduced XWiki. Some users asked to have the search bar visible because they wanted to ā€œsave a clickā€. If you click on the icon the search input gains focus and you can start typing right away so it is one click regardless of the search bar being opened or not.

I’m surprised by this fact too, but surveys show that people rarely use this button. They mostly start searching the structure themselves. And this is despite the reminders and training materials about XWiki search we created specifically for users.

At the end of last year, we conducted a survey on employee satisfaction with XWiki. The top complaint was about the search. People find it inconvenient to use. And newbies don’t even notice the magnifying glass button. Therefore, if we could pin the search bar when it’s open, perhaps that would improve the situation.

And I agree with grimmksg: saving a click on expanding a line also seems like a reasonable argument

At all, young users are now accustomed to new tools, like intelligent assistants. After analyzing the survey results, we began considering implementing an AI assistant that would help users find the knowledge they need in XWiki.

Regarding Discourse, I’ve found this theme that makes the search expanded: Advanced Header Search - Theme component - Discourse Meta

One idea would be to provide an extension to install in XWiki to do something similar. Or simply decide to always have the search bar expanded. Or make that configurable (more code to maintain).

@tkrieck is that a topic you’ve explored already? Any opinion? Thx

About this, have you seen this experimental extension: https://extensions.xwiki.org/xwiki/bin/view/Extension/LLM/LLM%20Application/ ?

Thx

Yes, there’s a big discussion about this on Proposal for a centered search box in XWiki

Besides an always open design, the proposal also centers the search. They are not exclusive though, we could have it always open and to the right. Personally I’d go with an admin option for both:

  • centered [on/off]
  • always open [on/off]
2 Likes

ah yes, thx. I knew I was forgetting something :wink: