I am a newbie to Drupal. I am using Megamenu dropdown to display the Main menu in the site I am working on. But I need to override a function(megamenu_theme_menu_tree) in the Megamenu module file to add some html to megamenu output. Editing the module file works for me, but I am not sure its the right way to do it.

Is there any other way to do it?

Please help

Thanks

有帮助吗?

解决方案

In the file themes/[your_theme]/template.php, try to create a function to override it. For naming function, it is explained here

By the way, you should never override a function into its module. You have to create your custom module to override it. It's easier to keep your custom code if you need to update Megamenu for example.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top