Alpi87 Posted November 12, 2020 Share Posted November 12, 2020 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! Link to comment
Beyondspace Posted November 12, 2020 Share Posted November 12, 2020 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); } 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
Alpi87 Posted November 12, 2020 Author Share Posted November 12, 2020 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... Link to comment
Beyondspace Posted November 12, 2020 Share Posted November 12, 2020 <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 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
Alpi87 Posted November 12, 2020 Author Share Posted November 12, 2020 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. Link to comment
Beyondspace Posted November 12, 2020 Share Posted November 12, 2020 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> 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
Alpi87 Posted November 12, 2020 Author Share Posted November 12, 2020 When I put that code it changes the logo in all product pages but also in the shop page... Link to comment
Beyondspace Posted November 12, 2020 Share Posted November 12, 2020 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 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
Alpi87 Posted November 12, 2020 Author Share Posted November 12, 2020 OMG!! That worked perfectly! Thank you so much!🤓 Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.