Jump to content

Can I add a Scrolling Banner to a single product category page without it appearing across the entire shop?

Recommended Posts

On 1/25/2024 at 10:22 PM, tuku said:

Cool, thanks @tuanphan.

I've now added the banner to the Footer: https://echidna-mandolin-33c8.squarespace.com/shop/singles

Password: hello

I look forward to receiving the code for this. Much appreciated!

Move this?

image.thumb.png.f8fc08145e924a80403fca41242dde14.png

under header + above this?

image.thumb.png.3a31e091c2b0791151c38eebe2ceb004.png

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 weeks later...

Hi @tuanphan I've finally paid for the website now, so it's no longer in trial mode.
If you are still able to help with making the scrolling banner only appear on 'Singles' category shop page + 'Singles' product/item pages, that would be excellent.

Just a reminder; the banner is currently in the footer, ready to be repositioned under the Header with your code.

https://echidna-mandolin-33c8.squarespace.com/shop/singles

Password: hello

Thanks again!

Link to comment

Add this code to Last Line in Code Injection > Footer

<script>
  $(function() {
  var loc = window.location.href; // returns the full URL
  if(/singles/.test(loc)) {
    $('body').addClass('singles');
  }
});
</script>
<script>
  $(document).ready(function(){
    $('.singles footer.sections .marquee-block').insertAfter('.singles header#header');
});
</script>
<style>
  header#header + .marquee-block {
    margin-top: 176px;
    display: block !important;
}
</style>
  

Then add this code to Custom CSS box

footer.sections .marquee-block {
	display: none !important;
}

 

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

Hi @tuanphan Thanks for that.

 

There are just a few things I would like to adjust if you are still able to assist?

1.  After adding your code, the banner has moved up, but there is now a large empty area/padding below it which is pushing other sections down the page. Can we remove all excess padding above and below the banner?

2.  I would like the banner to sit flush to the Header's horizontal border line above it - is this possible? I presume it would be a matter of removing the banner's top padding.

3.  There is also excess empty space in the Footer, where the banner used to be. Is there a way to resolve this?

 

Thanks again.

Screenshot 2024-02-12 at 13.57.04.png

Screenshot 2024-02-12 at 13.57.35.png

Link to comment

Add this code under

<style>
  body.singles article section:first-child {
    padding-top: 10px !important;
}
</style>

With Footer, you can consider use Classic Editor Section instead, it won't create gap. Or you can edit footer > drag Scrolling Block up over another section.

Add Classic Editor1 Min

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

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.