Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Live search macro alignment

Boy May 11, 2013

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

2 votes
Answer accepted
nriley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 12, 2013

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.

John Paz
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.
October 10, 2013

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.

John Paz
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.
October 10, 2013

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>

 
nriley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2013

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
Chung Park Chan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 12, 2013

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.

Boy May 18, 2013

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
TAGS
AUG Leaders

Atlassian Community Events