Direct access to an accordion item - Forum | JoomShaper
Solved SP Page Builder

Direct access to an accordion item

Asked by AJCS 2 years ago Last activity 2 years ago

Hello

Can we access an item by URL if we use the accordion component of SP Page Builder?

We would like to have a link, and that shows the selected ITEM open.

thank you

Accepted answer

Marked as the solution

4 more replies

Pavel
2 years ago · edited

Hi.

By default, this is not possible with an accordion, not only in SPPB but in general.

You can write your JavaScript for this.

Approximately, the logic of the script is this:

(If the link is on another page)

If the URL contains your value, scroll the page to your element, open your accordion tab.

(If the link is on the same page)

Use anchor link to your element.
And through the onclick JS event, delete all the active classes from the accordion and add the active class to your accordion tab.

AJCS Asked this
2 years ago · edited

Hello

I don't quite understand how JS onclick works.
Can you send me a DEMO.
I attach a link to the hidden page. We are interested in linking by URL to some of the ITEMS, and having it open automatically.
thank you

Scott

Please clarify

A. Are you looking to link text or button from inside an accordion tab?

or

B. Link Text or button from another article page to a specific Accordion tab?

Pavel

Hi AJCS .

I attach a link to the hidden page.

I am not an employee of support. And as far as I know such things outside the support.

If you do not have the skills of JS coding, just hire someone for this work.

Log in to reply.