User login

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

function feature_frontend_preprocess_links(&$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)

The big core issue:
Custom menus never receive an active trail

Menu item in active trail is not expanded

Contact Menu - missing ".active-trail" class

missing active-trail class in front page primary links menu

Active trail being set incorrectly

Active trails for menu items in Drupal 7

Port menutrails module to d7

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: 


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>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

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