سؤال

i need a little help for this problem with Drupa7 theming. I need theming main menu with a class="active"

..my menu is on a block structure.

If my menu is Forum, and the path is mysite/forum.. class="active" appear and work perfectly on my <a> tag..but if i try to join on forum sections, the path become mysite/forum/2 (for example)and i lose my class="active" on <a>.

I need to maintain class="active" and my style on all sub sections of the forum. how i do this?

my css for ".active"

.leaf  .active .fontm {
    color: #FFF;
    font-weight: bold;
}

Thank in advance.

هل كانت مفيدة؟

المحلول

I think its not a CSS problem. Drupal only recognizes the url of the menu to add this class.

Maybe you can use this module to solve the problem: https://drupal.org/project/menu_trail_by_path

Regards.

نصائح أخرى

Just in case it is CSS issue, take a look at !important declarations. Otherwise, you should absolutely debug / pinpoint the issue & consider the tools/options available for doing so before you devise a solution in order to avoid headaches ahead. See below:

https://drupal.org/project/devel_themer or get more familiar with tools like Firebug or it could help to selectively disable CSS or JS]

Also be sure to clear browser cache AND Drupal cache all the time, make sure CSS/JS aggregation & caching are turned off on the Drupal Performance admin page, etc.

Along similar lines, it often makes sense to reduce & optimize existing CSS as much as possible, as you may find the offending code more easily this way.

Though less likely, your worst case scenario could be to track down JS causing the issue &/or looking more closely the PHP .module code & .tpl templates generating the menu on the bad page.

Also to note, unless your last resort, adding extra modules to resolve isolated theme issues can be a risky strategy- like using gum to plug leaks -piling up, reducing site speed or causing new issues.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top