문제

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