Page 1 of 2

Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 9:09 pm
by cerberus
Hi all,

How can I add a link in the admin section at the top of the page ? (where the other links are), see image where the red arrow is.

Thank you,
Steve

Screenshot 2026-09-17 220312.png

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 9:42 pm
by Kofod95
https://github.com/CE-PhoenixCart/Phoen ... ex.php#L36

In admin/index.php line 36 you find this code:

Code: Select all

$admin_hooks->cat('extraButtons') ?>
This is a hook listener, meaning that something calling that can be "heard".

So if you create a new file (example.php here) in includes/hooks/admin/index/example.php (note that this is from the Phoenix root, and not admin/includes/...) and add something like:

Code: Select all

class hook_admin_index_example {
  function listen_extraButtons(){
    $button = 'button';
    return $button;
  }
}
You should see the word "button" in that area. Of course, you should name the hook something else than "example" (both the file name and the class name within the hook - those must match), and of course you would change the $button to be what you actually want to output.

Hooks are explained various places on this forum and on GitHub, so you can learn much more. This should however give you the basic idea of how to use one.

//Daniel

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 10:05 pm
by cerberus
And their was me thinking I could just edit the file and add a text link that would open in a new tab :)

I am not creating a new page that I want to link to, I just want a link to a external web page (basically to a simple online image editor to resize images and crop before uploading to phoenix cart).

Those instructions seems a bit (a lot ) beyond me :)

But thank you.

I will just not link the editor to the shop :)

Steve

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 10:28 pm
by Dan Cole
This might be of some help.

app.php/addons/free_addon/quick_links_manager/

Dan

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 10:38 pm
by cerberus
Yes, I tried that one, but it does not give a option to open in a new tab, so it will take you away from the admin, then when you hit the back button you have to refresh the admin page. If I could get it to open in a new tab that would of been ideal.

At the moment I have given it the name "Simple Image Editor (right click then open link in a new tab)". So it will still be useful. But it would of been better if I had the option to select "open in a new tab".

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 10:57 pm
by Dan Cole
I haven't tried but that should be a fairly simple fix and a good learning experience for you. Google "html to open link in a new tab" or better yet, for a slightly deeper dive...

https://www.w3schools.com/html/html_links.asp

Dan

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 11:04 pm
by cerberus
I am ok with making a basic text link and to get it to open in a new tab, thats why I was originally asking about adding the link to the top of the admin page, but it seems it will not be a simple as I thought, it seems I cannot just add a text link to the top of the admin page.

And in the Quick Links Manager addon their is not a option to open in a new tab, their is only a place to add the URL you want to open.

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 11:16 pm
by Dan Cole
I liked your idea of opening the links in a new tab and adjusted the hook so it now does that. If you want to use the quick links manager, I can give you the update. Install it and let me know.

Dan

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 11:42 pm
by cerberus
ok thank you, I will use it :)

(the issue with how it is now is after you have clicked the link you have entered on the addon and it goes to the page, when you have finished and hit the back button on your browser to go back to admin you get a message saying "confirm form submission" and you have to refresh the admin page, so opening the external links in a new tab will solve that issue as well)

Re: Can I add a link to the top bar in the admin section ?

Posted: Thu Sep 17, 2026 11:54 pm
by Dan Cole
Let me know when you have the quick links manager installed and I'll send you the one file that needs updating.

Dan