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

This widget could not be displayed.

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

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?

This widget could not be displayed.

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

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
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

475 views 6 6
Join discussion

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