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

change logo in ONLY product pages


Alpi87

Question

  • Answers 8
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Posts

OMG!! That worked perfectly! Thank you so much!🤓

Hi bangank36, thank you for your reply. I knew this already and it does the job. However, for some reason the effect of the filter in my white logo is not very good. In some desktop screens it appears

It does not work... I have tried targeting "body.collection-type-products .Header-branding-logo" and "body.collection-type-products .Header-branding img" and it still does not work.  

Posted Images

8 answers to this question

Recommended Posts

  • 0
2 hours ago, Alpi87 said:

Site URL: https://www.murmali.com/shop/cork-bucket-gamma-natural

Hi there! I am trying to change the logo in only my product pages (all of them). The logo from the product pages is automatically taken from the shop page. How can I change the logo in product pages while keeping the logo in the shop page? 

Thanks! 

There is class name in product page for body, if you want logo in black on shop just use this

body.collection-type-products .Header-branding img {
  filter: invert(1);
}

image.png.89f8c3dddeac93bdcf75510425140c83.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement, Enable Pinch/Zoom on lightbox, 360 degree photo blockSortable Table from GSheet
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to post
  • 0

Hi bangank36, thank you for your reply. I knew this already and it does the job. However, for some reason the effect of the filter in my white logo is not very good. In some desktop screens it appears thicker and kind of blurry. When I change the logo in the shop page to the black logo, in the product pages it appears perfect. That's why I need to change the logo and not just apply a filter on the one taken from the shop page.

I know that with the following code I can change the logo in any page of the site (except for the  product pages)

<script> window.onload = function() { document.getElementsByClassName('Header-branding-logo')[0].src = 'URL'; } </script>

However I do not know how to target just the logo in the product pages...

 

Edited by Alpi87
spelling mistake
Link to post
  • 0
<script> window.onload = function() { document.querySelector('body.collection-type-products .Header-branding-logo')[0].src = 'URL'; } </script>

.collection-type-products is the class of product page body

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement, Enable Pinch/Zoom on lightbox, 360 degree photo blockSortable Table from GSheet
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to post
  • 0
6 minutes ago, Alpi87 said:

It does not work... I have tried targeting "body.collection-type-products .Header-branding-logo" and "body.collection-type-products .Header-branding img" and it still does not work.

 

It's my bad

<script> window.onload = function() { document.querySelector('body.collection-type-products .Header-branding-logo').src = 'URL'; } </script>

 

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement, Enable Pinch/Zoom on lightbox, 360 degree photo blockSortable Table from GSheet
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to post
  • 0
5 minutes ago, Alpi87 said:

When I put that code it changes the logo in all product pages but also in the shop page... 

<script> 
  window.onload = function() { 
    var logo = document.querySelector('body.collection-type-products:not(#collection-5ebae83d182f400f38e71560) .Header-branding-logo');
    
    if (logo) {
    	logo.src = 'URL'; 
    }
  } 
</script>

This will exclude the shop, let me know, thanks

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement, Enable Pinch/Zoom on lightbox, 360 degree photo blockSortable Table from GSheet
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to post

Create an account or sign in to comment

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


×
×
  • Create New...