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

Open to all! Ask other shopowners for help.
cerberus
Member
Posts: 86
Joined: Sun Sep 06, 2026 10:54 pm
Phoenix Version: v1.1.0.7
Has thanked: 20 times
Been thanked: 6 times

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

Post 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
You do not have the required permissions to view the files attached to this post.



Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
Kofod95
Senior Contributor
Posts: 766
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.21
Has thanked: 103 times
Been thanked: 188 times

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

Post 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

cerberus
Member
Posts: 86
Joined: Sun Sep 06, 2026 10:54 pm
Phoenix Version: v1.1.0.7
Has thanked: 20 times
Been thanked: 6 times

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

Post 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

Dan Cole
Senior Contributor
Posts: 548
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 77 times
Been thanked: 68 times

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

Post by Dan Cole »

This might be of some help.

app.php/addons/free_addon/quick_links_manager/

Dan

cerberus
Member
Posts: 86
Joined: Sun Sep 06, 2026 10:54 pm
Phoenix Version: v1.1.0.7
Has thanked: 20 times
Been thanked: 6 times

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

Post 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".

Dan Cole
Senior Contributor
Posts: 548
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 77 times
Been thanked: 68 times

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

Post 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

cerberus
Member
Posts: 86
Joined: Sun Sep 06, 2026 10:54 pm
Phoenix Version: v1.1.0.7
Has thanked: 20 times
Been thanked: 6 times

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

Post 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.

Dan Cole
Senior Contributor
Posts: 548
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 77 times
Been thanked: 68 times

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

Post 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

cerberus
Member
Posts: 86
Joined: Sun Sep 06, 2026 10:54 pm
Phoenix Version: v1.1.0.7
Has thanked: 20 times
Been thanked: 6 times

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

Post 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)
Last edited by cerberus on Thu Sep 17, 2026 11:57 pm, edited 3 times in total.

Dan Cole
Senior Contributor
Posts: 548
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 77 times
Been thanked: 68 times

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

Post 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



Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply