My name is Karis, I work for Harvard Business Publishing (HBP) and I have recently been promoted to creating and maintaining a Knowledge Base for the customer facing support department. HBP has an installation of Confluence and many different groups within the company have spaces. We are using our space (called Customer Service) within the company wide Confluence installation to house the Knowledge Base of which I'm in charge. I'm giving you this background so that you understand context for my question.
I need to limit the search box that appears in the upper right on every page by default: I need to limit this search box to only search our Customer Service space - but - and I think this is the key, I need to set this default for only our space. As in, the Marketing group has their own space and I don't want to limit the search box in their space to only searching within their space, but I do want to set this restriction on the search box on pages within our space. Does my request make sense? Is it possible?
Karis, this cuztomization requires you to use it under the HTML macro:
https://confluence.atlassian.com/display/DOC/HTML+Macro
You can try the following cuztomization with on your page/space:
<form method="POST" action="/dosearchsite.action" name="searchForm" style="padding: 1px; margin: 1px">
<input type="hidden" name="quickSearch" value="true" />
<input type="hidden" name="searchQuery.spaceKey" value="spacekey" />
<input type="text" accessKey="s" name="searchQuery.queryString" size="25"/>
<input type="submit" value="Search Space Name"/>
</form>
Replace the value of "spacekey" in the searchQuery.spaceKey hidden item for the space key of your space.
You only need to insert it through the desired page/space and then replace the name="searchQuery.spaceKey" for name="searchQuery.The Space Key of your Space".
In example, I have a space named "Careful With That Axe, Eugene" and the spacekey for it is CTE. I've replaced the SearchQuery to name="searchQuery.CTE".
Hope it helps you, Karis.
All the best for you.
Thanks. Is it easy to modify that to cover (a) a number of spaces or (b) spaces having a certain space category tag?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could this be modified, restricting empty space keys, in order to prevent that questions are visible to everybody?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Giuliano C_
Thanks a lot for the HTML Code.
Would it be possible to Add two spaces in the Value Parameter, as I need to limit the search to two different spaces (not possible with any other makro)
Thanks so much for your reply!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much for sharing this! I was looking for this exact solution, and you seem to be the only one mentioning, that such a feature exists. For everyone else looking for this feature, you'll find it navigating to "Browse" > "Space Admin" > "Themes" > "Configure theme" > "Limit search results to the current space"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As a space admin I'm unable to find this in version 5.7.3 of Confluence. There's a Themes tab under Look and Feel but there's no Configure option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe that, under Themes, you must choose "Documentation Theme". After that you get the Configure option. (This is why I always use the Documentation Theme. I have observed no or almost no negative side-effects of it.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mikael Mikkola Thank you!
That was very well hidden... It works however I had to change color scheme and somehow my sidebar does not display our space logo so it's harder to navigate to space home page. I hope I can fix this by manually editing the custom sidebar wiki markup (Themes > Navigation).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Big fan of limiting search to current space. Only problem is the Documentation theme seems to get less attention from Atlassian. Check out https://jira.atlassian.com/browse/CONF-5338
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used this setting for awhile and it was great. Then my space was auto updated to a new theme that doesn't have this setting. It's very irritating.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An alternate solution is to remove the (global) Quick Search from the header bar and add the Livesearch macro to the Sidebar, Header or Footer. This takes up a little more space, but including the search in the sidebar intuits that you are searching the space tree so we like locating it there.
Remove the Quick Search:
#quick-search{
display:none;
}
Add Live search:
{livesearch:spaceKey=YOURSPACEKEY|placeholder=Search this here space}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I tried above solution but it doesnt work. I have injected following htmls in form section of search box
<input type="hidden" name="quickSearch" value="true" />
<input type="hidden" name="searchQuery.TP" value="spacekey" />
"TP" is my space key.
I am using Confluence 5.4.3.
I also want user to search with in sapce not in all available space.
Any help is appreciated...
Thanks in advanced
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.