I’m kind of stuck on what the best option would be for the navigation on my site. I like things like the updating ones found here, but they’ve used Javascript and I’ve seen people talking about disabling Javascript entirely. I’m just annoyed by having to manually update everything each time I want to add a page! What do you prefer when you visit sites? What do you do on your own site?
The current version of my website has a “/menu” page to which every page and post links. That way, if I add more pages, I need only link to them in one place.
my site navigation from the homepage is inconvenient on purpose because it’s fun
generally speaking my site navigation style on my site is like hubs n spokes. dunno if there’s a word for it. but like the main page links to sections, and a section page links to the pages in that section.
there’s mooostly no navigation bar or menu or anything, but i do have some in some places. zonelets, which uses javascript, for my blog for example. i don’t especially care about making it useable to noscripters so i dont worry about it.
for the cover art museum i just copy and pasted the nav bar along with the rest of the page template for every page
i don’t have much of a preference when it comes to other sites! i like em all. dropdown menu, sidebar, top bar, menus, hubs, imgmaps, iframes, whatever haha.
you could do the javascript one you linked with an iframe instead if you don’t want to use javascript! iframes are useful for that sort of thing. instead of doing the <script></script>
on every page just do an <iframe src="navigation.html"></iframe>
instead. iframes are a bit of a pain to format and position sometimes but you can usually browbeat them into cooperating with enough fiddling and container divs
Thank you both for your input!
@xixxii Oh yeah, I know about iframes! My concern is that they might be harder to format so they’ll look consistent across devices. I could be wrong but they seem harder to pull off.
I use a static site generator (specifically Eleventy) to build my website, so I can set it up to automatically update my navigation bar with a link to a new page. On mobile view, my navigation bar becomes a navigation menu that I made by using the HTML popover
attribute).
That said, as the number of links I want to add to my navigation bar grew, I decided to make an Explore page to list the top level links on my websites, to give visitors a page to navigate my website with those links.
Like Leilukin, I use a static site generator so that I can edit my menus in one place and have them appear on every page. It’s very handy!
Other ways to achieve this (aside from JavaScript) include PHP and I think server side includes, but since I use hosting for static sites those aren’t really an option.
I actually use a completely static site with no iframes or generation or javascript at all; I just use my coding app (notepad++ lol) to do a mass find+replace when I want to edit it across all my pages :)
This actually sounds really practical!
A big thanks to everyone who’s replied. I feel a bit more reassured about using a javascript navbar and will probably do that since it sounds like more practical option for me right now. That said, I always enjoy reading about how people make choices for their sites, so feel free to keep those replies coming
I used an accessible menu made by someone else which handles dropdowns as well that can be navigated by keyboard too :] … it is using javascript though, but either way I use javascript on my site to put my header, footer, and sidebar specifically so I don’t need to re-do them for every page
I’ve been thinking recently about how sites are organized and visualized and how to add things like menus and footers to every page. I wrote two pages, one about site maps and visualizations and the other about the different methods I know of for adding menus and reusing other pages.