django-unfold icon indicating copy to clipboard operation
django-unfold copied to clipboard

Add nested navigation support in sidebar

Open Biftor opened this issue 1 year ago • 2 comments

Hello,

I hope this message finds you well. I wanted to bring up a suggestion for enhancing the user experience on your great project. It would be fantastic if you could consider adding a feature that allows users to collapse the side menu for each section with a default setting (either open or closed).

Additionally, I noticed the absence of nested items, and I think it would be a valuable addition. For example:

Section 1: (collapsible) Item 1 Item 2 Nested Section 1: (collapsible) Item 1 ... Item 3 Nested Section 2: (collapsible) Item 1 ... Section 2: (collapsible) Item 1 Item 2

If the functionality is already supported, could you please guide me on how to use it or direct me to relevant documentation?

Thank you very much for considering this enhancement. I appreciate your time and effort in maintaining the project.

Best regards, Armin

Biftor avatar Jan 03 '24 01:01 Biftor

👋 Hey Team,

Long time listener, first time caller.

The django-unfold project has been beneficial.

I wanted to start with genuinely appreciating all the hard work and time you have spent building something like this and making it available as opensource. I am surprised people need to talk about it more.

Just echoing @Biftor enhancement request, I was looking for some way to make the sidebar navigation collapsible and stumbled here.

I have reviewed the entire documentation and codebase (with my limited knowledge) multiple times, and I didn't find any option (please correct me if I am wrong)

If the functionality is not even on the roadmap, could I request some guidance us how we could implement it by ourself?

ishangirdhar avatar Mar 04 '24 09:03 ishangirdhar

+1 to this feature --

For my own project, I didn't implement nested, but I was able to override the templates to add support for collapsible by overriding this template src/unfold/templates/unfold/helpers/app_list.html

See my gist for the template to override and template tags required: https://gist.github.com/thalida/bc5aa52eb3cd6dd536657b635166601a

There may be a better way than adding my own custom template tag to figure out the active items on the sidebar, but what I have works.

unfold-sidebar

thalida avatar Jun 06 '24 22:06 thalida

Added #551

lukasvinclav avatar Jul 09 '24 11:07 lukasvinclav