Jump to content

How to redirect search icon to a specific page

Go to solution Solved by tuanphan,

Recommended Posts

  • Replies 10
  • Views 524
  • Created
  • Last Reply

Top Posters In This Topic

7 hours ago, rhondahymason said:

Hi guys,

When visitors click the Search icon in my mobile header, is there any way I can get it to redirect them to a specific search page on my site rather than just bringing up the default search page?

Thanks,
Rhonda

We can achieve it with some javascript which is only available on business plan or the above ones. What is your current plan?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
On 11/5/2022 at 9:02 PM, bangank36 said:

We can achieve it with some javascript which is only available on business plan or the above ones. What is your current plan?

I'm currently on the Business Plan.

If I can successfully redirect it, then I can stop stressing about the colours of the header on the mobile search page! 🙂

Edited by rhondahymason
Link to comment
On 11/7/2022 at 10:55 AM, rhondahymason said:

I'm currently on the Business Plan.

If I can successfully redirect it, then I can stop stressing about the colours of the header on the mobile search page! 🙂

If you share link to your site, we can give javascript code to do this.

Or we can use code to insert custom search icon with custom url

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 11/18/2022 at 9:44 AM, rhondahymason said:

Hi @tuanphan, sorry, I've added the search icon back now.

I would love to have it redirect to a specific page rather than the default Search page (so that I can style it the way I want).

Thanks so much!
Rhonda 

Hi,

I still dont see search icon on header

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • Solution
On 11/22/2022 at 5:17 PM, rhondahymason said:

@tuanphan It only appears in the mobile view. Thank you for your time!

Add this to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function() { 
		$('.Mobile-bar.Mobile-bar--top .Mobile-bar-search').attr('href','https://google.com');
	});
</script>

Replace google with new page url

If the code work when refresh page only, disable Ajax Loading at Design > Site Styles

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 months later...

Create an account or sign in to comment

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

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.