Keep accordion tab open and the accordion item link state active after page reload

Hi,
I built this site a few months ago:
http://www.psai-szeged.sulinet.hu
It is a pure Foundation site. :slight_smile:
I would like to build better left side nested accordion menu, like https://get.foundation/sites/docs site left side accordion, where the accordion item link keep the active state after page reload (when the new content load to right side).
Actually I can’t find the simple solution for this.
Thank you for help!

Hi,

This component is called Magellan.
https://get.foundation/sites/docs/magellan.html

Did you already try this?

Dear Daniel!

Long time ago I used a Magellan to build a landing page, but after I forget it… :slight_smile:
Thank you very mutch for a quick help!

Istvan

I tried, but it is not the perfect solution for me. If you see the https://get.foundation/sites/docs/ LEFT accordion, I want same like this. After page reload, the left side accordion link keep the active state (the link is blue, not gray). I can’t find any similar soultion in Foundation Kitchen Sink.
Can you help?

We do multiple things. We track the state if it should be expanded using the localstorage: https://github.com/foundation/foundation-sites/blob/0f9fea524fec599999fdd952d55de94635f75227/docs/assets/js/docs.js#L25, we

And we manually set the is-active and is-current classes depending on the current page, see https://github.com/foundation/foundation-sites/blob/0f9fea524fec599999fdd952d55de94635f75227/docs/partials/component-list.html#L29-L32

And there is also https://get.foundation/sites/docs/accordion.html#accordion-and-urls

Yep, it works for me…
The panini handlebar in li tag is very fine!
Thanks a lot!