Questioning navigation source order

Events happening in the community are now at Drupal community events on www.drupal.org.
jjeff's picture

For the most part, I'm completely happy with the XHTML source ordering for Zen. I love that we've got the content ordered before the sidebars. However, I have to admit that on a regular basis, I have been frustrated by the way that the navigation works (and/or doesn't work).

The current source ordering has #navbar after the content, but before the sidebar regions. This means that #navbar ends up requiring a bit of delicate wrangling, being sure to determine an exact height for the #navbar and then setting that as the margin-top for the #content, #sidebar-left, and #sidebar-right. And on a regular basis (particularly on error pages), I find that for one reason or another, the #navbar ends up falling below the content (I have yet to track down the cause of this).

My points for discussion are:
* We've already got the #header appearing before the #content. Are we really gaining more than we're losing by putting the #navbar after the #content?
* And for alternate outputs, for instance a mobile device, isn't it actually better to have the navigation at the top?
* If we were to make this change, is there a way to do it without borking existing sites if they upgrade their Zen?

Please discuss.

-Jeff

p.s. I'd love to point, once again, to the wonderful View Source Chart FireFox extension. It provides a great way to get a quick overview of what's happening HTML-wise for any page.

Comments

I concur!

niklp's picture

Re your points Jeff (concisely numbered of course :p )

  • I think the nav should be at the top... I can't see that there is any marked gain by placing it under the content, /really/ ?
  • For mobile sites, yes the nav should be up there.
  • might bork existing sites, but I have to say, when I used the new version for the first time, I was all up like wtf in my own face or something very confused by the arrangement. I would perhaps provide an upgrade path / guidelines to change it, and deal with it? Won't most ppl override that style anyway?

Web Development in Nottingham, UK by Kineta Systems

I think it depends...

Moonshine's picture

I probably shouldn't be posting without at least one cup of coffee, but I think the costs/benefits (at least partially) depend on what you are tossing into #navbar. For some it is just simple navigation, for others it could be a wickedly large code chunk for dynamic menuing. Of course the same thing could be said about #header, although I have a feeling people don't get as crazy there.

I have no idea how much benefit is derived from it being below content, but it certainly would involve changes in the CSS for all of my designs. (Not that they would be difficult at all.) I guess, given the option, I think it's safer to keep it below and make sure content is always first.

As far as mobile goes, I think Zen should actually have a seperate simplified template and style set as it's base if we're talking about truely crippled WAP style devices. Of course "mobile" is changing a lot with the iPhone, Nokia N810, etc. So maybe it's just a matter of waiting things out. :)

history

mikejoconnor's picture

Why was the navigation placed below the content to begin with?

SEO

Moonshine's picture

Search engine optimization. Google and others don't like to see content burried later in the page. The question is really what is considered "later" in the page really.

Google

jjeff's picture

This is only a slightly-educated guess, but I get the feeling that Google's indexer has some intelligence around #main and #content (and .content) divs being more "important" than #header, #left, #right, etc... It just makes sense that they're putting more importance on these than what's first.

That being said, it also makes sense that they would give a site "extra points" (and assume that it's more credible) for being XHTML/standards compliant, validating, and even having nicely-ordered source code.

-= Jeff Robbins | Lullabot | Drupalize.me =-

Positioning + Google

kmonty's picture

Like most people, I suspect your "navbar" has only the Primary links in it, thus not moving the content down that much. I would say that on 85% of the sites I work on, I manually move the navbar to be above the content because it can be more reliable that way (as jjeff says, the navbar can fall below content), nicer to mobile/screenreaders (I know screen readers have the skip-to-nav link, but what if they want to hear their options and then go back to the content?) and, in my mind the most significant reason: The navbar is often not designed within div#main. Take a few examples.

Example 1) Primary in the header. Many sites do this and its current setup is not ideal for moving it to this position. You have to undo all the positioning done in css and move it out of #navbar in page. Not the biggest deal in the world, but it still exists as a common use-case problem. (Live example: http://blog.torproject.org/ )

Example 2) #navbar outside of Main. On more complex designs, we can find the site content/sidebars have borders, gradients or a color that is not shared by the primary. While the primary may not be in the header, it cannot be within the #main div. We are faced with the minor problems before, but again, it's not a good starting point. A good example of this would be tabs sitting ontop of the main content.

Zen is designed for this example in mind, which I personally have not encountered much, although I know it is common on many sites and blogs. This design is not made more difficult by moving navbar to be above #main.

Agreed

echoz's picture

Yep, one of the first things I did with source ordered zen was move navbar up under the header, because I don't want to specify a height (and the corresponding top margins), and to me, was not worth the trade off.

Definitely

patrickharris's picture

I'd love to get the #navbar above the #content. I frequently don't want a navbar of a fixed height, and I find the current navbar's positioning and clearing causes headaches on sites that have complicated css.

I think it's an urban myth that Google will punish a site that has a #navbar of a few links above its content.

Different perspective

jeff1970's picture

Normally I move it up the top also - partly because it can be a bit tricky with the CSS but mainly because I want to pop-the-top with my primary links.

I've noticed on pages with a lot of content there can be a marked delay in the appearance of the navbar - esp if you have a slow connection.

That said, I personally would stick with the status quo, and write a tutorial on how to modify the nav in different ways - I would even volunteer to do this. I think this would markedly reduce support requests and forum posts on this subject and give us something to point noobs to when they miss it in the docs.

Originally I supported keeping things the same because change could break a lot of existing websites. However I no longer support the status quo and believe this should be changed because it breaks the web for a significant number of users. Recently I have been working with accessibility issues and content source order is vitally important to many blind screen reader users. Zens insistence on placing the navigation after the main content breaks with preconceived notions of "where" the majority (actually 100% in a recent research paper) of screen reader users expect the main navigation to be. Additionally, having actually worked in SEO for more than 5 years I can categorically state that placing the nav after content makes no difference. Its boilerplate.

navbar tutorial

mjasonbaker's picture

I think a tutorial on how to modify the nav would be great. I also think it would be quite helpful to possibly have a place where all the sub-themes we are making could be showcased (like zen garden does!) This way, perhaps we could more intuitively see how things work or different ways to manipulate the theme while keeping the integrity of the project.

I also noticed that the notes, css and regions differ between the Starterkit and the Zen classic. It would be nice to have sub-themes noted by contributors if they have done anything progressive, tricky, or complex so noobs (like myself) are able to catch on quicker.

If you do a tutorial, or beef up Zen in any way, I would be happy to help/add the perspective of someone versed in css and xhtml, but only 6 months deep into drupal/php/zen and perhaps shed light on where documentation still doesn't cover what new users find challenging.

this is a pretty old thread,

KrisBulman's picture

this is a pretty old thread, and it appears the zen layout has stayed the same throughout time. what are peoples thoughts on this in 2011?

I find myself still pulling the navbar out and putting it above the header so i can add additional regions like a "featured" region. I'm not completely up to speed on the SEO reasoning for navbar below content, however there are quite a few people who think it's the only way to go.

If keeping the navbar below content.. and dropping the content/sidebars down.. what are peoples methods of adding new regions below the navbar and above the sidebars?