How to add a searchbox in confluence sidebar?

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 )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

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("", {"page": $confPage, "context": $context}))
	$helper.renderConfluenceMacro("{livesearch:spaceKey=TES|size=medium|placeholder=Search this space}")

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.

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

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}")


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
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

879 views 2 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you