2

I just started to learn and to develop a Drupal 7 site; therefore, I don't know Drupal very well.
How can I create the menu used in these two sites, http://www.honda.com.my/ and http://www.toyota.com.my/index.html?

  • Related (or possible duplicate): How do I make a mega-menu? – kiamlaluno May 1 '11 at 2:30
  • Both sites have different menus (as far as I could see), which one do you wish to replicate? – Dipen May 1 '11 at 4:39
  • something like those both site, which can have a menu drop down with list of those product. I mean like both have the product name with the product picture? Is it possible to use together with a view?so that can add the content dynamically? or any other method as long as it can be dynamic.. – arkchong May 1 '11 at 14:14
  • Not a replicate of "How do I make a mega-menu?" as it's a little more specific and ask for inclusion of pictures related to entries in the mega menu and, possibly, for automatic menu generation from "product". – Pierre Buyle May 2 '11 at 6:01
3

There is three sides to the question.

One is to make dropdown multi-columns menu, also called mega menu. The Superfish module should provides that. But I'm sure there are others.

The second is to have pictures associated with the menu entries. One solution is to use pictures associated to the pages linked from the menu. If all the pages are nodes, this can be done by using a file (or media) field. Another solution is to use picture associated to taxonomy terms. And to use these terms as categories for the pages (through classic term-node association or any other solution). To get the picture for a menu entry, simply get the image for the term associated with its page.

Instead of looking for the pictures of menu entries when building the menu, which could be query intensive, I would rather use a custom menu callback to deliver the picture of a menu entry. The menu callback takes a single argument, the menu path, and ends by issuing a redirect (ie. drupal_goto()) to the picture to use. Off course, use an image style to resize the pictures to fit in the menu.

The third question is to automatically generate a menu from the products list (nodes). I'm not sure this is actually wanted. The menu in Drupal are dynamic and can be edited at any time by users with the right permissions. On creation a node can be placed in a menu. If automatic menu are needed, custom code may be needed. The Auto Menu provides this feature even if it has not been ported to Drupal 7. The Taxonomy Menu produces menu from taxonomy hierarchies, so if product are terms this can work too. If coding is an issue, the Rules menu can provide the necessary tools to implement any custom menu entry creation logic. The solution really depends on the actual site structure.

Off course, you can also bypass the menu system and produces your menu using Views or custom code, but it means you will end up with a full-custom solution which won't be able to re-use any existing module, or even code snippets, targeted at normal Drupal menu.

  • well, I think I use a half hard coded way to achieve this. Create a content from a views, then add that views into a block and make that block hidden. use jQuery to make it show or not show. – arkchong May 10 '11 at 17:57
2

An easy solution can be to use nice_menus and override their theme_nice_menus_build function.

Depending on your needs, you could call a block view from there, using views_embed_view, or any other kind of PHP logic you might need.

1

For Drop down menus there are modules like nice menus , super fish and mega menu. Mega menu is still in the development satge. You can go with any one depending on your requirement.

protected by Clive Jan 24 '13 at 15:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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