hi again,

i'm finding it really hard to work out how to get my breadcrumb working for a content type i setup with cck. i created a news article content type, and what i really want is to click on a news article and the breadcrumb to appear as

home > press > news > the title of the news article

nothing i do works however, and my breadcrumb remains

home > the title of the news article

the news article itself has a URL of press/news/the-title-of-the-news-article so that's fine, it's just the damn breadcrumb. all my other breadcrumbs are working perfectly for normal page content assigned to menus, it just seems to be this cck content type that does provide a meaningful breadcrumb

help?!

Comments

adcworks’s picture

is this not something everyone does? it's just a breadcrumb. website navigation class 101. tomorrow is going to be an appalling day trying to figure this out ... are there no expert tips on this simple question?

zub@drupal.org’s picture

try to use taxonomy and toxonomy_context module:
add new vocabulary "Press" and new term "News". associate your news article with this term.
install taxonomy_context and use settings for your content types admin/settings/content-types to chnge "Show taxonomy breadcrumb:" to "Enabled".

Then your breadcumbs at your article page must be "home >> press >> news" i think.
I do so at my site http://test.eyecatchingscreens.com/screensavers/winter_town_3d_screensaver , but i don't use cck - i use my own module for screensaver type.

adcworks’s picture

I've got something working using the category module like this. I created a normal menu item 'Press'. To that I added a container 'News'. To that I added a category 'Article'. I created my CCK 'news' content type. When I create the news content, I assign it to the 'Article' category.

When I visit the news content, I get a breadcrumb of 'Press' > 'News' > 'Article'

Clearly this is not quite there yet, since what I want is 'Press' > 'News' > 'Title of new content'

I have a hack to get this working in the absence of not knowing the real way. In template.php I added a pop of the breadcrumb array when it matches Article, e.g.

if ($breadcrumb[count($breadcrumb) - 1] == "<a href=\"/article\" title=\"\">Article</a>") {
  array_pop($breadcrumb);
}

And also in page.tpl.php I change the breadcrumb print to use the $title var exposed by Drupal

<?= $breadcrumb ?><?= $title ?>

This gets my breadcrumb how I want it BUT ... is there a way to remove the 'Article' category from appearing in the breadcrumb using the category config??

Thanks!