Hi,
I’m in the process of trying to create a side navbar that I can use as a symbol on all pages of my website. The website is for a clothing store selling a large variety of different products and I would like to recreate something similar to this example using webflow (in the top left corner users can navigate different categories)
I have created a test however I have encountered two problems which I hope should be fixable with a workaround however after messing around myself for a few hours I decided to ask here to see if anyone had any good ideas.
Here is my test example so far:
https://thrifty-store.webflow.io/styles
Please note that as it is a test, only the Shop>Mens>Tops>Shirts will work as intended for now.
It works somewhat, however I have two problems with it that I would like to fix.
Problem 1: When I collapse the parent option, other options inside that parent remain open.
For example, if I click Shop>Mens>Tops and then decide I want to collapse the menu by pressing Shop again, the menus will collapse, which is great. However if I press Shop a second time, it will open all the categories within Mens>Tops as they were not closed manually previously. If possible I would like it so that when pressing the parent element, all children within the element are also collapsed and returned to their former state.
Problem 2: When I select a category and the correct page is loaded, the menu reverts back to it’s original state.
Ideally I would like the page to remember the state of what options are currently showing/hiding when transitioning from one page to the next, although I am not sure if this is possible within webflow.
It may be worth mentioning for clarification I will be using this as a symbol on all of my ecommerce pages within my website too, so it would need to function as a symbol on my product and category template pages too.
Here is my read only, although I am in the process of experimenting so the contents of the project may change. The bar I am trying to create is on the Styles page.
UPDATE: Since posting this I noticed that @PixelGeek has posted a very helpful tutorial on how to do something similar, however I am still struggling due to the complexity of what I am trying to do. In his video he achieves this by using the following custom CSS and JQuery codes:
CSS:
.Category-Div {display:none;}
JQuery:
$(‘.Sidebar-Text.w–Current’).parent().show();
However, due to my website being an ecommerce site I am having problems. Because I want the links to go to my category pages, I am having to set the links up as an external URL rather than a page link within my webflow project. Webflow only lets me set up page links to regular webflow pages and not specific ecommerce pages, as this is what the point of a CMS collections list is for. I seem to be unable to use the ‘Current’ class as I am having to set my links up using external URL’s the link back to my website, rather than using the standard webflow page links.
Unfortunately the ecommerce CMS collections list will not allow me to create subcategories or organise them how I would like, which would mean this option would have to have one huge long list of all my different categories which would look very messy and be inconvenient for customers.
Apologies for the long post but as it is quite a complex thing I am trying to do I wanted to be as clear as possible for everyone to see the problem. If anyone needs me to explain anything again (as I am sure my explanation wasn’t great) then please just ask and I will try to clear it up.
Thank you to anyone who was taken the time to read, if anyone is able to offer advice then it would be greatly appreciated!