(this requires a 3rd party plugin)
Description
- Clicking on an anchor link (text link, button, image, video…)
- Browser will Open a New Page, Scroll down to an Accordion Block & Open specific Item in the Accordion Block
How to
#1. First you need to install Accordion Pro Plugin
Plugin has 2 versions. You need to use Older Version for Classic Editor
When you download plugin & open the documentation page > Scroll down to the bottom > You will see a link to older version
#2. Access Older version & add plugin code to Code Injection Footer
#3. Add an Accordion Block with plugin’s instruction
In the plugin older documentation page, you can follow steps to add an accordion.
But note a thing
Let’s say you have an accordion item named Web Design. You want this item to be opened when the anchor link is clicked. Then you will need to use the code below.
- Here I added id=”second-item” data-init-open
- data-init-open means open item on page load
- id=”second-item” is the anchor id, after reading this guide, I guess you will know how to rename it
<div class="wm-accordion-start" id="second-item" data-init-open> Web Design </div>
#4. Add an anchor link
Edit page where you want to add anchor link and enter link.
Let’s say I have inserted the Accordion in the page whose url is: https://blank-test.squarespace.com/anchor-link-accordion
The anchor id is: id=”second-item”
So the url you need to insert to Button/Image/Text Link is
/anchor-link-accordion#second-item
Done. That’s all.
You can see a demo
https://blank-test.squarespace.com/anchor-link?noredirect pass: abc
#5. FAQ
If you want to click the anchor link, it will scroll to the accordion block on the same page, use this url
#second-item
See a demo
https://blank-test.squarespace.com/anchor-link-accordion?noredirect pass: abc