User login

Notes and links on hacking in a custom active state path for menu links

<?php
function feature_frontend_preprocess_links(&$variables) {
 
kpr($variables);
}
?>
... (Array, 5 elements)

    links (Array, 6 elements)
        menu-975 (Array, 3 elements)
        menu-356 (Array, 3 elements)
        menu-358 active-trail (Array, 3 elements)
            attributes (Array, 2 elements)
                title (String, 4 characters ) News
                class (Array, 1 element)
                    0 (String, 12 characters ) active-trail
            href (String, 4 characters ) news
            title (String, 4 characters ) News
        menu-359 (Array, 3 elements)
        menu-456 (Array, 3 elements)
        menu-899 (Array, 3 elements)

https://drupal.org/project/menu_position

The big core issue:
Custom menus never receive an active trail
http://drupal.org/node/942782

Menu item in active trail is not expanded
http://drupal.org/node/1060974

Contact Menu - missing ".active-trail" class
http://drupal.org/node/1062776

missing active-trail class in front page primary links menu
http://drupal.org/node/1035020

Active trail being set incorrectly
http://drupal.org/node/1040002

Active trails for menu items in Drupal 7
http://www.designhammer.com/blog/active-trails-menu-items-drupal-7

http://data.agaric.com/why-isnt-drupals-one-run-time-menu-item-altering-hook-getting-run

Port menutrails module to d7
http://drupal.org/node/940206#comment-4897132

If none of the above makes sense, i do have it working in (i think) feature_frontend.module in the SDL project, and so can look it up there.

Searched words: 
template_preprocess_links

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.