having trouble with navigation

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

Hi,

I'm new to Drupal and could really use your help. So far, I'm really impressed with its powerful possibilities, but am stuck on the basic issue of how best to organise the navigation for my newspaper site.

I'm using Drupal 5.

I want to organise my content as follows:
- 1 level of sections for news (eg. politics, international, etc.) - each news item will be associated with just one section. This list of sections will form a horizontal nav menu
plus
- for each news item, a secondary subject matter - assigned as a freetag.

Eg. A news piece on Barack Obama could have as its primary section "International" and a tag of "US Elections". Clicking on the "International" link would bring up all other pieces in this section. Clicking on "US Elections" would bring up all pieces tagged with "US Elections".

I started doing this with taxonomy but have run into difficulties:

  1. When viewing the example news piece, I'd like there to be a breadcrumb: home > international > US Elections > title
    I've tried custom breadcrumbs but can only use the top level taxonomy term. Is there a way to incorporate a second taxonomy term?

  2. For the sake of usability, I need the menu item "International" to keep its active class when viewing any node in this section. This seems like it should be simple, but I can't find a solution. Am I missing something?

I've been playing around with menus, taxonomy, cck, custom breadcrumbs, taxonomy context, etc. but can't find a combination of these to fit my needs.

I'd really appreciate your help with this.

Thanks.

Comments

No breadcrumbs, I think

itangalo's picture

Hi and welcome to Drupal!

Using breadcrumbs as you suggest will probably be very difficult, unless you make all the free tags sub-terms of your main sections. For Drupal, the two taxonomies are non-related, and there is no way it can tell that "US election" belongs to "International" rather than "Sports". It might be possible to do this, but I think it'll take some hours of thinking and some customized code.

An easier way is probably to adjust the theme and (1) disable the breadcrumbs and (2) insert a "home >" plus "section term >" plus "free tag". It will look and work just like a breadcrumb, but are actually just links to two taxonomy lists. (And I think you're completely on the right track when using taxonomy.)

Making the "International" menu item keep it's active class could also be made in the theme. A short php snippet could check whether the active node has a section term matching the menu item, and if so adding the relevant class.
A better solution might be to write a small module that injects the class text, but I don't really know how to write modules. =)

Well, I hope this might help you find a solution you like.
Good luck!

//Johan Falk, Sweden

Agree, inserting custom code

shyamala's picture

Agree, inserting custom code to generate the Breadcrumb would be the best solution! I love taxonomy too and all the taxonomy lists that get generated. Do not forget to list the associated tags along with the articles, these too provide links to the different taxonomy views. You may want to try http://drupal.org/project/custom_breadcrumbs, http://drupal.org/node/72850.

Netlink Technologies Ltd
http://shyamala-drupal.blogspot.com/

Thanks

freatida's picture

Thanks for your suggestions Johan. Ok, I'll stick with taxonomy and try to change the theme. I thought maybe I was missing something obvious - particularly with the active class thing, which seems quite important for usability. I've found some other posts raising this issue but no elegant solution yet. Oh well.
Thanks again.

Check Garland theme

nimbupani's picture

They have an implementation for active menus in templates.php. You might want to understand that code to find out how to do your active menus.


http://nimbupani.com/blog

Thanks but can't find anything in Garland

freatida's picture

I've looked at template.php but as far as I can tell, it seems to have the same problem in that it doesn't keep the primary menu item active when you're on a page in that specific section. Like the Drupal site itself. I'm in the "groups" section right now, but the groups tab at the top of my page doesn't have an "active" style.

Newspapers on Drupal

Group organizers

Group categories

Topics - Newspaper on Drupal

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: