1

I'm currently developing a module for a friend and need to add a link into the admin flyout menus. I'd prefer not for him to have to edit the files, but so far that's the easiest way I've seen to insert these links (hardcoded into the admin header, that is).

The modules work so well that I can't believe there's no easy way to add in an admin link as such. I could always add it into the module settings page, but that seems to defy the purpose of the module settings.

Any help is appreciated.

shadyyx
  • 15,825
  • 6
  • 60
  • 95
Andrew Klatzke
  • 554
  • 2
  • 4
  • 15

2 Answers2

7

The simplest way is to edit all the necessary files, thus controller admin/controller/common/header.php - add the name of the link and the action of the link, language file admin/language/<THE_LANGUAGE(S)>/common/header.php - add the entry name, the template admin/view/template/common/header.tpl - add the menu link entry where applicable.

Little harder way is to do the same via vQmod extension...

shadyyx
  • 15,825
  • 6
  • 60
  • 95
  • +1 I would also mention to make sure you leave #hashtag based comments in your code mentioning the changes, so group the #hashtag change so you can find and replace later - as the core changes will be removed on upgrades on OpenCart Websphere Commerce. – TheBlackBenzKid May 07 '13 at 15:12
  • Yep, that's why I mentioned (**and always recommend**) doing such changes by `vQmod` XML extensions... – shadyyx May 07 '13 at 15:17
  • Well this didn't answer the question. I was asking for anything BUT this solution. He will be updating, etc on his own and I don't want him to have to edit the files at all when installing the extension. – Andrew Klatzke May 08 '13 at 01:32
  • There is not anything else BUT this solution... I do not understand the downvote, though. If You know better solution, use it. If not, this is the only one I know about (and I guess all other OpenCart developers, too). Use **vQmod** and there is no problem with the updates... – shadyyx May 08 '13 at 09:19
0

Can you not just have a script that appends your <li> to <ul id="menu"> when the page is loaded?

flcoder
  • 713
  • 4
  • 14