Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add a searchbox in confluence sidebar?

Matt Lundstrom September 4, 2015

Hello. Thanks for reading!

I am trying to add a simple searchbox above the Page Tree in the sidebar when using the confluence default theme. We're already heavily invested in configuring this theme to our liking and this is one of the final steps.

I've modified multiple decorator style layouts inside the Confluence admin area and added #searchbox() (per https://confluence.atlassian.com/display/CONFEAP/Working+With+Decorator+Macros )to multiple lines but never got anything to show except the actual text which was on the page and not the sidebar.
I also opened up and edited a couple .vm files and inserted that same decorator macro as mentioned on the page above (Again - #searchbox()) with no result anywhere. 
Can someone point me in the right direction to throw a simple searchbox at the top of the page tree in the sidebar on the default theme?

Thanks in advance!

 

2 answers

1 accepted

1 vote
Answer accepted
Taha Khanzada
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2015

Go to Page Layout and may be modify this as below

#if( ($mode != "edit" && $mode != "edit-preview" ))
<content tag="ia-sidebar">
	#foreach ($webPanel in $webInterfaceManager.getDisplayableWebPanels("atl.page.left.sidebar", {"page": $confPage, "context": $context}))
	    <br/><br/>
    	$!webPanel.getHtml($action.context)
		<br/><br/>
    #end
	$helper.renderConfluenceMacro("{livesearch:spaceKey=TES|size=medium|placeholder=Search this space}")
</content>
#end
Matt Lundstrom September 8, 2015

Thanks! The line breaks only move the searchbox down so I have to find a way to squeeze it in but this works. Thank you again.

Natalie S_ November 24, 2015

Matt, did you ever figure out how to tweak this so it looks right in the sidebar?

1 vote
Taha Khanzada
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 5, 2015

Hi Matt,

You can give it a try with this, use $helper.renderConfluenceMacro in your layouts to render Confluence macros, for example: Use Confluence livesearch macro
$helper.renderConfluenceMacro("{livesearch:spaceKey=DOC|size=large|placeholder=Search this space}")

Taha

Matt Lundstrom September 7, 2015

Thanks for that, Taha. Unfortunately, I still can't get any code (or text for that matter) to show up on the Confluence sidebar. I've tried editing the Space layout, the Page layout as well as multiple .vm files. Can you point me to which file it is that spits the code out for the sidebar? Thanks again for your assistance. It's much appreciated

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events