10

Drupal 6.17を使用していて、ブレッドクラム出力の「HOME」を削除したい...

例えば:

$breadcrumb=製品//ソフトウェア//機能

それ以外の

ホーム//製品//ソフトウェア//機能

4

6 に答える 6

7

Drupal7バージョンは次のとおりです。

/**
 * Get rid of Home in breadcrumb trail.
 */
function <themename>_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];

  if (!empty($breadcrumb)) {
    // Provide a navigational heading to give context for breadcrumb links to
    // screen-reader users. Make the heading invisible with .element-invisible.
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

    array_shift($breadcrumb); // Removes the Home item
    $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
    return $output;
  }
}
于 2012-02-15T15:45:03.253 に答える
5

テーマの template.php ファイルでブレッドクラムをオーバーライドします。

/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 */
function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    array_shift($breadcrumb); // Removes the Home item
    return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
  }
}
于 2010-08-26T22:09:32.697 に答える
1

ブレッドクラムのテーマ出力 HTML
カスタム ブレッドクラム

于 2010-08-26T21:51:04.360 に答える
0

templated.phpで、「ホームページ」かどうかを尋ね、言語固有にします。言語検索が必要ない場合は、 (&& $ language_url-> languag**eおよび**global$ language_url; )を取り出してください。また、「href」の「/ htdocs / drupal/de」を適切なURLに変更します。

function _YOUR_THEME_NAME_breadcrumb(&$variables) {
    $breadcrumb = $variables['breadcrumb'];
    global $language_url;

          if (drupal_is_front_page()){
              return;
              } elseif(!empty($breadcrumb) && $language_url->language == 'de') {
              $breadcrumb[0] = '<a href="/htdocs/drupal/de">STARTSEITE</a>';
                $breadcrumb = implode(' | ', $breadcrumb);
                return $breadcrumb;
            } 
}
于 2013-03-07T01:51:39.013 に答える
0

パス ブレッドクラム モジュールがインストールされている場合。構造 > パスのパンくずリスト > パスのパンくずリストの設定に移動し、[単一のパンくずリストのパンくずリストを非表示にする] をオンにして、構成を保存し、ページを更新します。終わり。

于 2013-09-25T11:28:21.727 に答える