0

I had asked this exact question on StackOverflow, until I cam across this StackExchange site...makes much more sense to post this here!

I'm using nice_menus-6.x-2.1 with Drupal 6.22 and would like to know if there is any way to rewrite the menu output so that the end-result resembles the following:

<ul>
    <li><a href="node/xx">Parent Link 1</a></li>
    <li>
        <a href="node/xx">Parent Link 2</a>
        <div>
            <ul>
                <li><a href="node/xx">Child Link 2<span>[Description]</span></a></li>
                <li><a href="node/xx">Child Link 2<span>[Description]</span></a></li>
            </ul>
        </div>
    </li>
    <li><a href="node/xx">Parent Link 3</a></li>
</ul>

Basically, I only want the customization on the second tier of sub-menus onwards. The <div> wrapper is there for styling purposes. The <span> within the link tag is supposed be the description that you usually get on mouse-over, but I want this to show a bit smaller below the link (but be part of the link itself, and therefore not outside the <a> tag). I'm sure this is possible? I just don't know where to start. I'm looking within nice_menus.module but can't seem to find the function for the children rewrite. I currently have this working in a mock using plain HTML markup and CSS, but I just can't work out how to customize the PHP function in Drupal.

Has anyone been through this and would care to share?

Thanks a million everybody!

1 Answer 1

1

Probably you would just want to implement your own version of theme_nice_menus_build(), and add all your required divs/spans right there.

4
  • ok, thanks Maciej! How do I go about doing that? Sorry, I'm newish to Drupal...but going thru all the reading material I can to understand the core system better.
    – Shalan
    Jun 29, 2011 at 13:07
  • drupal.org/node/341628 Jun 29, 2011 at 13:14
  • thanks, I'll post back here if the article contains what I'm looking for
    – Shalan
    Jun 29, 2011 at 14:06
  • thanks Maciej, the links toward the bottom seem to point me right direction.
    – Shalan
    Jun 30, 2011 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.