What is the best method for creating a site where there is a unified information architecture reflected in path aliases and breadcrumb (menu too, i imagine)?

Say I want to set up a set of site sections and subsections like so:

arts
music
design
theater

sciences
physics
chemistry
astronomy

so a page in the astronomy sub-section would have the path: /sciences/astronomy/solar-system-101
and the breadcrumb would be: home > sciences > astronomy > solar system 101

I was looking at a combo of taxonomy, pathauto, and custom breadcrumbs, but I am not sure how to deal with those subsections. a page just under 'sciences' would be /term/page-title. but the subsection of 'physics' only has the term 'physics' applied, and so pathauto woudl generate /physics/page-title, and not /sciences/physics/page-title. Custom Breadcrumbs seems to be the same.

How can I get these hierarchical structures reflected in the path aliases and breadcrumbs?

Comments

jenlampton’s picture

What you ask is easy to do with url aliases, harder for menus, and currently impossible with breadcrumbs.

for URL Aliases you want to use the token for term-path not just term. that way it will include the parents as well as the term itself.

for Menus, the best solution out there is the Menu Trails module.

I'm working on another module that will set the breadcrumbs based on the url (since that's easy, and in a well-designed site they should always match!)

This url / breadcrumbs is my current biggest pet peeve with drupal 6. They worked in 5! now we have to manually set the breadcrubs everywhere we want them... a huge oversight imo.

Jen

Jeff Burnz’s picture

I hear your pain regarding breadcrumbs, I have a function I've been re-using for about 2 years that uses the URL to set the breadcrumb, works perfectly and saved me so much time and hassle.

techypaul’s picture

Please elaborate!

reibian’s picture

I found the following at a blog site by Andrew Riley. I'm sending him a "good karma" regardless whether it solves my problem or not. ;)
Is this related to this? http://drupal.org/node/155624

function phptemplate_breadcrumb($breadcrumb) {
        $uri_request_id = $_SERVER['REQUEST_URI'];
        $urlexplode = explode("?", $uri_request_id);
        $url = explode("/",$urlexplode[0]);
        $args = count($url);

        $output =  " home";
        $path = '';
        $replace = array('_','-','+','%20');

        // If there is more than one directory or page after home print it
        if(isset($url[1]) && $args > 1){
                for($x = 1; $x < $args; $x++) {
                        $text = htmlspecialchars(str_replace($replace,' ',$url[$x])); 
                        if($x < ($args-1)) {
                                $path .= '/' . urlencode($url[$x]);
                                $output .= " > <a href=\"" . $path . "\">" . $text  . "</a>";
                        } else {
                                $output .= " > " . $text;
                        }
                }
        }
        return '<div id="breadcrumb">' . $output . '</div>';
}