fuel_nav active class looking to location or nav key?
Hi, let's say I have the following navigation structure:
- Company Part 1
-- Part 1 Home
-- Part 1 etc
- Company Part 2
-- Part 2 Home
-- Part 2 etc.
Basically Company Part 1 and Part 1 Home are referring to the same url, let's say /part1
But for the design I created this structure and using the parent option in fuel_nav.
For Company Part 1 and Part 1 Home, I have to use different Nav Key's because FUEL doesn't allow you to create duplicates. The problem now is that the active class won't work because of these duplicates. So my question is: Is the active class looking to the nav key, or the location to check if the navigation element is the active url?
I should say it should look to the location of the navigation element and compare it with the current url.
Comments
$nav['company_part1'] = array('label' => 'Company Part 1', 'active' => 'company_part1$|company_part1/home$'); $nav['company_part1/home'] = array('label' => 'Company Part 1 Home');
There is also a ":children" value you can pass to active/selected which will make that menu item active for anything under "company_part1".
In /fuel/modules/fuel/libraries/Menu.php I changed the use_nav_key to 'location' but it doesn't seem to work.
Matching the current url to the target (location) url instead of nav_key of the navigation item would be more logic to me.
echo $nav_arr = fuel_nav(array('depth'=>1
,'render_type' => 'basic'
, 'group_id' => 1
, 'active_class'=>'active'
,'container_tag_attrs' => array('style' => '')
,'container_tag_class' => 'nav navbar-nav'
,'order' => 'precedence'
,'use_nav_key'=>TRUE
,'subcontainer_tag_class'=>array('','','')
));
can you please hep me on it