You can send your questions to my email to get faster answer in 24 hours (free).
Buy me a coffee

Click text – Show Newsletter (v2)

Demo: https://tuanphan-demo01.squarespace.com/click-text-show-newsletter-v2?noredirect

Password: abc

Suppose you have 2 Texts and 2 Newsletters.

And you want: when clicking on the Text, the Newsletter will appear below it.

You can follow these steps:

#1. First, add 2 Text Blocks and 2 Newsletter Blocks

click-text-show-newsletter-01-min

#2. Edit 2 Text Blocks, and use these URLs:

  • #forbuyer
  • #forseller

and make sure the option “Open Link in New Tab” is disabled.

click-text-show-newsletter-02-min

click-text-show-newsletter-03-min

#3. Install Squarespace ID Finder to find the ID of Buttons and Newsletters.

In my example, we will have:

  • For Buyer: #block-72f9289f871ee0647273
  • For Seller: #block-yui_3_17_2_1_1710835889994_7364

 

  • Newsletter For Buyer: #block-2a9e335f0165e01e2396
  • Newsletter For Seller: #block-31f4f1ab195999def93c

click-text-show-newsletter-v2-01-min

#4. Use code to Code Injection – Footer (or Page Header Code Injection)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  // For Buyer 
  $("#block-2a9e335f0165e01e2396").closest('.fe-block').addClass('forbuyer show');
  // For Seller
$("#block-31f4f1ab195999def93c").closest('.fe-block').addClass('forseller');
  
  // For Buyer 
  $('a[href="#forbuyer"]').click(function(){
    $(".forbuyer").addClass("show");
    $('.fe-block:not(.forbuyer)').removeClass('show');
    }
  );
// For Seller
 $('a[href="#forseller"]').click(function(){
   $(".forseller").addClass("show");
    $('.fe-block:not(.forseller)').removeClass('show');
    }
  );
});
</script>
<style>
.forbuyer .newsletter-block, .forseller .newsletter-block {
    display: none;
}
  .show .newsletter-block {
      display: block !important;
  }
  .show {
      z-index: 999999 !important;
  }
</style>

click-text-show-newsletter-v2-04-min

#5. Explain code

click-text-show-newsletter-v2-05-min

Ask me a question, free

If your site is private or in trial, just setup password and share url. See how to: https://beaverhero.com/squarespace-how-to/
Please check your email carefully. Recently I got a lot of questions with wrong emails.

If you haven't heard from me within 24 hours please check your junk/spam folder