一旦您通过单击子菜单请求页面,我想隐藏子菜单项的路径,该路径显示在面包屑中。
这是我用来创建一个菜单项和三个子菜单项的代码:
$items['what-to-expect'] = array(
'title' => t('What To Expect'),
'page callback' => 'pvmf_layout_what_to_expect',
'access arguments' => array('access content'),
'menu_name' => 'main-menu',
'type' => MENU_NORMAL_ITEM,
'weight' => 1,
'expanded' => TRUE
);
$items['what-to-expect/0'] = array(
'title' => t('Local Event'),
'page callback' => 'pvmf_layout_what_to_expect_0',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
'weight' => 0
);
$items['what-to-expect/1'] = array(
'title' => t('Online Event'),
'page callback' => 'pvmf_layout_what_to_expect_1',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
'weight' => 1
);
$items['what-to-expect/2'] = array(
'title' => t('ONE Presenters'),
'page callback' => 'pvmf_layout_what_to_expect_2',
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
'weight' => 2
);
在我更改type
定义后,这里是我得到的代码:
$items['what-to-expect'] = array(
'title' => t('What To Expect'),
'page callback' => 'pvmf_layout_what_to_expect',
'access arguments' => array('access content'),
'menu_name' => 'main-menu',
'type' => MENU_VISIBLE_IN_TREE,
'weight' => 1,
'expanded' => TRUE
);
$items['what-to-expect/0'] = array(
'title' => t('Local Event'),
'page callback' => 'pvmf_layout_what_to_expect_0',
'access arguments' => array('access content'),
'type' => MENU_VISIBLE_IN_TREE,
'weight' => 0
);
$items['what-to-expect/1'] = array(
'title' => t('Online Event'),
'page callback' => 'pvmf_layout_what_to_expect_1',
'access arguments' => array('access content'),
'type' => MENU_VISIBLE_IN_TREE,
'weight' => 1
);
$items['what-to-expect/2'] = array(
'title' => t('ONE Presenters'),
'page callback' => 'pvmf_layout_what_to_expect_2',
'access arguments' => array('access content'),
'type' => MENU_VISIBLE_IN_TREE,
'weight' => 2
);
但是面包屑仍然继续显示。我试图通过转到Configuration
->来清除缓存Performance
,但它没有帮助。我在这里可能会想念什么?
我检查了它menu.inc
实际上包含:
/**
* Menu type -- A "normal" menu item that's shown in menu and breadcrumbs.
*
* Normal menu items show up in the menu tree and can be moved/hidden by
* the administrator. Use this for most menu items. It is the default value if
* no menu item type is specified.
*/
define('MENU_NORMAL_ITEM', MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB);