Closed kepiej closed 7 years ago
Academic doesn't support sub-menus. The general philosophy with the theme is to keep the interface simple, so this feature probably won't be added anytime soon.
You can customize the navigation bar for your purpose by copying themes/academic/layouts/partials/navbar.html
to layouts/partials/navbar.html
(relative to the root of your site). Your version of the navigation file will then override Academic's file.
Thanks for the reply. I was able to get it working! The modification turned out to be quite simple. I now have submenus (but not submenus in submenus). They are specified using the parent field. I attach my modification for anyone interested in the future: navbar.html
Thanks for sharing your modification @kepiej . I just tested it out - the required code changes for the feature are more minimal than I expected and it doesn't break compatibility with the existing example site menu or the active link highlighter (Bootstrap scroll spy). Thus, I've had a change of mind and will integrate it shortly 😃
Great to hear! Happy to help and thanks for incorporating this! :)
Thanks for the reply. I was able to get it working! The modification turned out to be quite simple. I now have submenus (but not submenus in submenus). They are specified using the parent field. I attach my modification for anyone interested in the future: navbar.html
@kepiej Please tell me after you've done navbar.html how did you make submenu in menus.toml?
Thanks for the reply. I was able to get it working! The modification turned out to be quite simple. I now have submenus (but not submenus in submenus). They are specified using the parent field.
I attach my modification for anyone interested in the future: navbar.html
@kepiej Please tell me after you've done navbar.html how did you make submenu in menus.toml?
Have a look at my repo: https://github.com/rodrigoalcarazdelaosa/rodrigoalcarazdelaosa.me where I use submenus
Thanks for the reply. I was able to get it working! The modification turned out to be quite simple. I now have submenus (but not submenus in submenus). They are specified using the parent field.
I attach my modification for anyone interested in the future: navbar.html
@kepiej Please tell me after you've done navbar.html how did you make submenu in menus.toml?
Have a look at my repo: https://github.com/rodrigoalcarazdelaosa/rodrigoalcarazdelaosa.me where I use submenus
@rodrigoalcarazdelaosa I saw it, thank you very much. But I didn't find navbar.html file in your layouts/partials/?
Thanks for the reply. I was able to get it working! The modification turned out to be quite simple. I now have submenus (but not submenus in submenus). They are specified using the parent field.
I attach my modification for anyone interested in the future: navbar.html
@kepiej Please tell me after you've done navbar.html how did you make submenu in menus.toml?
Have a look at my repo: https://github.com/rodrigoalcarazdelaosa/rodrigoalcarazdelaosa.me where I use submenus
@rodrigoalcarazdelaosa I saw it, thank you very much. But I didn't find navbar.html file in your layouts/partials/?
That feature was added years ago 😉. No need to add any custom partial
@rodrigoalcarazdelaosa I understand, thank you again 👍
Even after reading this issue I didn't realize this was a working feature without custom partials. I was really happy to discover it is baked in!
I think it might be good to add a "how to edit the menu" docs page to the wowchemy docs or possibly modify the example academic template to include a simple submenu so the functionality is demonstrated.
Is it possible to create submenus?
I would like to create a menu with an item "Research" and then submenus with "All publications" and "Work in progress". Ideally, clicking on (or hovering over) "Research" reveals the 2 submenus. Similarly, for "Teaching" I would like to create submenus.
The Hugo documentation mentions the use of the "parent" field to create nested menus, but this does not appear to work.
I'm still very new to Hugo, so I apologise if this is a silly question. Any help is very much appreciated.