learning-unlimited / ESP-Website

A website to help manage the logistics of large, short-term educational programs
82 stars 57 forks source link

bigpicture nav not highlighted when link redirects #3596

Closed willgearty closed 1 year ago

willgearty commented 1 year ago

It's very common for programs to assign links to the nav bar that ultimately redirect to other pages. For example, /learn and /teach always redirect to /learn/index.html and /teach/index.html, respectively. The nav bar in many themes is designed to highlight the "selected" nav link, but this is broken if the ultimate URL does not match the URL listed for a nav bar item. See here for an example: https://dev5.learningu.org/teach/Splash/index.html (the "Euro Splash" link was clicked to get to this page).

Note: I only observed this with bigpicture, but this may be (and probably is) an issue with other themes

willgearty commented 1 year ago

It looks like the code that makes the tabs "active" is here: https://github.com/learning-unlimited/ESP-Website/blob/1ca94bfb0ba283575261d3a2246c46fe93fdb63f/esp/public/media/scripts/nav.js#L14-L17