By tahiticlic on
Hi,
I have to create a primary links with multi levels elements (I need this to be primary in order to use Context functions). This is ok, but the element linking to front page is always in active trail.
This is in menu.inc where there's these lines in the menu_set_active_trail function :
$trail = array();
$trail[] = array('title' => t('Home'), 'href' => '<front>', 'localized_options' => array(), 'type' => 0);
I can't figure out why this homepage is always set to be in active trail... Could someone explain?
Is there a way to have only an active trail without "front" element?
Regards,
cfab
Comments
.
Not always. From what I see,
- menu_set_active_trail() can set the active trail, if you provide one.
-
<front>is added to the active trail onlyThat is, "if you are not setting a new trail, and no trail has been previously set either."
Why? One of the possible choices has been set as the default behavior. Is it unreasonable for some reason?
Well, yes I've seen that
Well, yes I've seen that test.
My goal is to have a multi lev primary links with "active-trail" class on the active trail menu elements, for this, I'm using menu_set_active_trail() function, which call menu_set_active_trail() without arguments. With front element included, I've both the active elements and the home page that are activated...
For my own purpose, I've used a "array_shift" call to remove front to be included. That works well.
Drupal rocks!
www.tahiticlic.com