Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

[SOLVED] Adding a code block (or a google custom search engine) to the site header (7.1)


dl_23

Question

Since I haven't been able to get the search block to work, I decided to go with Google's "Programmable Search" and just paste the HTML to a code block. However, I'd like to have the search bar in the header instead of taking up space on every page. Any suggestions would be greatly appreciated. Thanks!

Edited by dl_23
Specify version
Link to comment

6 answers to this question

Recommended Posts

  • 1
On 9/28/2021 at 9:26 PM, dl_23 said:

Exactly!

Add to Last Line in Code Injection > Footer

<script>
  $(document).ready(function() { 
		$('div#block-aada196faed00d4629aa').insertBefore('nav.header-nav-list');
	});
</script>
<style>
  .header-nav-wrapper {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
  div#block-aada196faed00d4629aa {
    flex-basis: 60%;
}
</style>

image.thumb.png.935c4423a5c3a76250bdfdb0cf33c60b.png

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 1
On 9/26/2021 at 8:58 PM, dl_23 said:

Hey @tuanphan

Sorry, just saw this!

site: https://tarantula-porcupine-bkrr.squarespace.com/

The password is 1234

Hi,

You want to move this?

image.thumb.png.3d6b2052438f3ae18f89a655bde0e13c.png

Email me if you have need any help (free, of course.). Answer within 24 hours.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 0
5 hours ago, tuanphan said:

Add to Last Line in Code Injection > Footer

<script>
  $(document).ready(function() { 
		$('div#block-aada196faed00d4629aa').insertBefore('nav.header-nav-list');
	});
</script>
<style>
  .header-nav-wrapper {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
  div#block-aada196faed00d4629aa {
    flex-basis: 60%;
}
</style>

image.thumb.png.935c4423a5c3a76250bdfdb0cf33c60b.png

 

This worked great, thanks! However, is there a way to control the width of the search bar so that it doesn't push the header navigation links to two rows?

 

Edited to add: Nevermind. Just changed flex-basis to 40% and it worked. Thanks so much again!

Edited by dl_23
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...