Community forum for knowledge and support

Updated 10 months ago

remembering sidebar state across pages

At a glance

The community member is working on a CMS page and has noticed that the sidebar on the Webflow preview remembers its collapsed state, but on the staging environment, the sidebar starts expanded on each page. The community member would like to have this feature be consistent across the website. A comment suggests that the community member would need to use JavaScript to "remember" the sidebar state and store it in cookies, but the commenter is not familiar with how to implement this. The comment suggests using tools like GPT or Slater.app to generate the necessary JavaScript code.

Not an issue but a question: is there a way if a sidebar is collapsed, that the next page remembers that state in order to avoid each page to start expanded?
I'm working on a CMS page and on the Webflow preview it works like a charm but obviously on staging, each page starts with the expanded sidebar. I would love this little feature to be consistent through the website I'm building πŸ˜‡

M
1 comment

you would need some JavaScript to "remember" that and store in cookies - that is outside my understanding but you could try using GPT or Slater.app to generate this JS for you.

"On click of this collapse button, I want to store a cookie that remembers this setting and it does not expire for 365 days" or something.

Add a reply
Sign up and join the conversation on Slack