Same active ID's with lower level menu

Bug #954161 reported by simonv
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Pluck CMS
Fix Committed
Low
Unassigned

Bug Description

Since my navigation menu had to have 1 lower level, I added following code to theme.php:

<?php theme_menu('ul', 'li', 'active', 1); ?>

However, the lower level links are displayed when the parent page is active for which the parent receives the ID 'active'.
Identifiers should be unique and therefore this ID should occur only once within a page, but when a lower level menu item becomes 'active', it too has the same ID.

<ul><li id="active"><ul><li id="active"></li></ul></li> ... </ul>

I already "fixed" it by changing the following line within data/inc/functions.site.php:

if ($level > $page_level && is_dir(PAGE_DIR.'/'.$file))
    theme_menu_data($block, $inline, $active_id, $level, PAGE_DIR.'/'.$file);

TO:

if ($level > $page_level && is_dir(PAGE_DIR.'/'.$file))
                 theme_menu_data($block, $inline, $active_id."".$level, $level, PAGE_DIR.'/'.$file);

Which results in different "active" ID's for different levels.

<ul><li id="active"><ul><li id="active1"></li></ul></li> ... </ul>

After which I simply added #active1 to the style.css.

Another option would be to change the active ID to CLASS, but for some reason I went for this option.

Related branches

Uranium235 (uranium235)
Changed in pluck-cms:
status: New → Confirmed
Changed in pluck-cms:
importance: Undecided → Low
Revision history for this message
Uranium235 (uranium235) wrote :
Changed in pluck-cms:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.