English 中文(简体)
• 如何在面包 to中展示分类
原标题:how to show taxonomy subcatgory in breadcrumb of drupal

I am using Taxonomy_Manager and Menu_breadcrumb modules
my categories looks like:
+BUSINESS
++Agriculture ++Banking & Finance
++Construction & Real Estate
+News
++ Behind the news
++ Peace and War

now the question is: if i browse any sub-category, it will not appear in the breadcrumb (the breadcrumb will be "Home>>") while if i browse one of the main categories, it will appear normally in the breadcrumb ("Home>>News")
i have tried taxonomy_breadcrumb but this didnt fix the issue :(
how can i set the subcategories to appear in the breadcrumb??
Thanks for your help

问题回答

我解决了我所有的面包.-经济相关问题,这些问题超越了蒸汽面包店的功能。 你必须走到你的主题上,在你的模板中增加以下职能。 php档案。

function YOUR_THEME_NAME_breadcrumb( $variables )
{
    // init
    $breadcrumb = $variables[ breadcrumb ];

    // taxonomy hierarchy
    $hierarchy = array();
    if (arg(0) ==  taxonomy  && arg(1) ==  term  && is_numeric(arg(2))) 
    {
        $tid = (int)arg(2);
        $parents = array_reverse(taxonomy_get_parents_all($tid));
        foreach( $parents as $k=>$v)
        {
            if( $v->tid==$tid ) continue;
            $breadcrumb[] = l($v->name,  taxonomy/term/ . $v->tid);;
        }
    }

    // rendering
    if (!empty($breadcrumb))
    {
        $output =  <h2 class="element-invisible">  . t( You are here ) .  </h2> ;
        $output .=  <div class="breadcrumb">  . implode("<span class= separator >&raquo;</span>", $breadcrumb) .  </div> ;
        return $output;
    }
}




相关问题
Drupal Multi-language: Simple strings not translated

I m adding additional languages to a Drupal site that I m building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date ...

Setting up a WYSIWYG editor for Drupal site users [closed]

Looking through the Drupal contrib modules, and after a few Google searches, it becomes evident that there are any number of choices and combos available to set up a WYSIWYG editor in Drupal. I m ...

Change size of user/password login box

I don t know how to change the size of the login username/password boxes on the drupal site that I m trying to build. I m stumbling through the theming, and don t know where to find the file that ...

How does Drupal provide an edit/review/publish model?

How does Drupal support a means to update and review a website before it is published? Does it only allow you to preview a page at a time before you publish it or is there a way to create a site ...

Term for rotating header

I m looking for terminology that describes this behavior: The header of a web-page contains a different image every time you visit it. Update: It is not an advertisement, but images related to the ...

Has anyone checked out Drupal 7? [closed]

Has anyone checked out a copy of Drupal 7 yet? What do people think? I m pretty excited about the PDO and all of the designers I work with a very excited about the new admin interface/structure. Do ...

热门标签