I am new to Drupal and am working to convert an existing site design. It seems that Drupal's concept of navigation is significantly different from my site's, in that primary links cannot connect to the navigaiton which (at least in my theme) is housed in the left nav. Here is an example of what I want to do: http://ist.berkeley.edu/services/. If you click on the Services tab, I want the subpages for only services to appear in the left nav. Though conceptually this really isn't a book, I read that books have their own navigation and tried to create each section of the site as a book (though I'd probably remove the 'paging' links at the bottom), but I can't figure out how to make the book navigation appear. I did try to create links for it in the left nav in Administer -> Site Building -> Menus, but maybe that's not the right thing to do. I am thinking I'd like it to look something like this: http://drupal.org/node/120612
However, conceptually using the book is really wrong, and kind of a hack. Is there a better way? I really have a problem with the way Drupal's navigation scheme works, at least on the examples I've seen, such as the Drupal site...for instance, on the New Drupaller's Cookbook above, the breadcrumbs say that it's in "Home >> Installation and Configuration". However, if I go to the home page, there is no link for "Installation & Configuration." How do you get there from home? After messing around for a while, I realized it should really be "Home >> Handbooks >> Installation & Configuration." It really seems like these primary links should be able to be connected to their sub-sections--it's just good usability. And where is the site map which would help me understand the organizational structure?
Comments
Starting Point
Go to admin/modules and turn on the menu module if it isn't on. The go to /admin/build/menu. The basic idea is you can create nested menus with any content you want. Each menu you create automatically makes a block which you stick on the left side/right side top/bottom of your theme. Blocks can be limited to logged in users, users of a certain role, nodes of a certain taxonomy term, and any number of other things.
The rest is mainly css/javscript setup for look and feel
I am using the Menu module
Thanks very much for your reply. I am using the Menu module, but the problem is visually I have two sets of links (see http://ist.berkeley.edu/services/) and if I separate them out into primary links and navigation, it seems I can't tie them back together (e.g. "technical account management", a navigation link in the left nav cannot be a link under "IST Services" in the primary links). Visually, I want them separate, conceptually I want them together.
I am a PHP programmer so I could maybe programmatically tie them together, but what do folks who are not do? Are you saying I should somehow put everything under "navigation" and then somehow pull out the top level links to the header? I didn't notice that the top level had a different style which would allow me to selectively pull them out. Also, it appears it would be very tricky to programmatically tell the left nav to display the appropriate sub items ONLY on the appropriate top nav page.
This is a really standard way to set up navigation on a website...there must be some easier way to do it?
This may be of help...
I would not try to tie the Navigation menu system with the Primary links, but I may get you started...
Primary links has a subset of links called secondary links. these are context sensitive links associated with the primary links.
eg:
-Primary Link
--Secondary Link1
--Secondary Link2
I think this is basically what you want to do. I think you will probably have to change where your secondary links are displayed by putting them in a block on the side (if that is how you want it to look). but you may still have the problem that when you select a primary link, it does not stay highlighted when you click on a secondary link. I solved this problem with a very simple solution for a site I was building.
I am not going to link the site since it is not live yet, but if you want to get a better idea you can send me an email through the contact form and I will show you.
Hope this helps... Good Luck...
Need deeper levels of links
I actually need multiple levels of links, third level, fourth level, etc. (see http://ist.berkeley.edu/services/tam/ for an example) Though Drupal allows me to make a 'tertiary link' which is child of my secondary link, I don't see it showing up anywhere. Also, how can I move just the secondary, tertiary, etc. links to the left nav? I only seem to have the ability to move 'Primary links' on the blocks page.
I found the answer
I found a really great solution to this problem in this post: http://drupal.org/node/77099. Be sure to follow the directions exactly, as I got tripped up when I didn't read carefully. For instance, I tried to put the code in the page.tpl.php file instead of block.tpl.php. I also had to change my "menu containing secondary links" the Settings tab of Menus to "No secondary links." If you want the secondary, tertiary links, etc. to appear in the left nav, when you enable the "Primary links" block in admin >> blocks, put it in the left nav.
A simpler solution?
Create a menu structure under primary links containing as many levels as you need, e.g.
primary 1
-secondary 1-1
-secondary 1-2
primary 2
-secondary 2-1
--tertiary 2-1-1
--tertiary 2-1-2
primary 3
-secondary 3-1
and so on. At risk of teaching you to suck eggs, these menus can link to static pages, books, views, terms, etc, what ever makes sense for your site/navigation structure.
Use menu settings to set primary links menu to "Primary links" and secondary links to "No secondary links".
Install and configure the Menu Trim module which provides "contextual secondary menu" based on the primary links. Instructions for configuring Menu Trim are on the module page.
This did it for me without any coding in templates, though I have now used mytheme_links() to override the display of the primary/inline links and mytheme_menu_item() to override the display of the secondary link menu trees.
The other thing I did was write a really simple module to enable a node to display the menu/breadcrumb of its referring page so that the navigation was retained when moving from teaser to page view.
Hope this helps (although I wait to be corrected by Drupalers far more experienced than me!)
Cheers,
Graeme.
Contextual Menu Block
I created a simple block that renders the sub tree for the currently selected menu link, using just a few lines of code and the menu api.
Create a custom block through the admin section, paste the following into the body of the block, and make sure to allow PHP Code as part of the body filter. Here's the code...
The way it ends up working is that if there is a sub tree beneath the page you are on, it renders it through the theming engine as a block, which you can display where you see fit. It does not appear if there is no sub tree.
For those of you PHP developers, it wouldn't be too much harder to make sure this is only rendered if the active page is part of primary links menu or some other custom created menu. Also, make sure that you have the menu items set to expanded or not expanded, depending on whether you want to show the entire sub tree or just the next level down...
If anyone more experienced with Drupal feels there is a more Drupal-esque way to do this, please let me know...
Module "Menu Block"
Module "Menu Block" gives a good solution (http://drupal.org/project/menu_block). No programming neccesary