Jump to content

[Share] Add Form Block into Accordion Block

Recommended Posts

Posted

You can use this quick tip to add a Form Block to Accordion Block.

If code doesn’t work, you can send page url, I will check again.

#1. Suppose you need to move this Form Block to Accordion Item 2

image.png.8de205a65ad6ec560512f8ba7a877f64.png

#2. First, you need to find Accordion Block ID, Form Block ID.

In my example, we will have:

  • Accordion Block: #block-yui_3_17_2_1_1729387285192_9027
  • Form Block: #block-yui_3_17_2_1_1730102697150_9202

image.png.c9defc3074fdd163a85579770db2d3ae.png

#3. Next, you need to know this.

image.png.17b7ed70c4b8f2fb729c67d7e908d161.png

#4. Use this code to Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
     $('#block-yui_3_17_2_1_1730102697150_9202').appendTo('#block-yui_3_17_2_1_1729387285192_9027 li:nth-child(2) .accordion-item__description');
});
</script>
<style>
.accordion-item__description {
    max-width: 100% !important;
}
.accordion-block .form-block {
    margin-top: 10px !important;
}
</style>

image.png.efbce732560d212be8c955dab76932c7.png

#5. Result

image.thumb.png.d8badf416e7a48e0e47470ff2ceb1f84.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!)

  • Replies 0
  • Views 267
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.