2013-05-24 08:37



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


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • douzuanze0486 douzuanze0486 8年前

    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.

    点赞 评论 复制链接分享