Live search macro alignment

Hi,

Is there a way to move the livesearch macro around the confluence page?
Because after inserting the macro, it's always floated to the left. What I would want is to make it center.

Thanks in advance! :)

2 answers

1 accepted

To a limited degree, my answer from https://answers.atlassian.com/questions/168704/live-search-macro-increase-search-box-size works here as well. You have some leadway in moving the containing div element for the livesearch box around the page using javascript/css as well.

Neal, could you please post a snippet of code to show how to do this? I've tried a ton of solutions, and I'm able to get it to align right, and to modify the size of the search box (to a point) using the solution on your initial answer to a similar question, but I can not for the life of me figure out how to get the darn search box to center!

It seems because the block element doesn't really have an align parameter like other elements might. But I could be wrong. Your guideance would be much appreciated.

Oh, and for good measure here is the snippet of code I've been using, which successfully changes the width of the search box...

I'm rather determined at this point to find some kind of solution...

<script type="text/javascript">
AJS.$("document").ready(function(){
    AJS.$(".plugin_livesearch_searchbox").css({
	"align-self": "center",
	"width": "1000px"
	});
});
</script>

 

I'm not sure align-self would actually center an element like an input box... You could try using the margin trick:

position: relative;
margin-left: auto;
margin-right: auto;

This would pad either side of the element automatically, and essentially center the input box in the parent div.

Hope this helps!

1 vote

Hi Bq0,

You might want to edit the Page Layout and choose the appropriate column settings. Then, add the Livesearch Macro in the desired column.

Hope this helps.

thanks. my workaround is that after editing the page layout, I added the Section and Columns macro to adjust the desired location for the livesearch box

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published 2 hours ago in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

17 views 0 1
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