wbrowar / craft-admin-bar

Front-end shortcuts for clients logged into Craft CMS.
MIT License
32 stars 9 forks source link

using adminbar on a multisite #18

Closed proximo7 closed 10 months ago

proximo7 commented 4 years ago

We'd love to use adminbar on our multisite setups. However, the bar doesn't show up using standard tags like {{ adminbar({ entry: entry }) }}

wbrowar commented 10 months ago

Hi, @proximo7, I'm sorry for letting this issue go for so long, but are you still having an issue using Admin Bar on multi-site projects?

I tested {{ adminbar({ entry: entry }) }} on a multi-site project on Craft 4 and it does seem to be working, pointing to the correct entry edit page. If there was an issue, it might have been resolved within a Craft update.

wbrowar commented 10 months ago

Oh, @proximo7, I don't know if this will fix your issue, but I just changed all of the CP URLs from using the url() Twig function over to use the cpUrl() function. This adds a site param to the URL now which should link you to the correct edit page.

For example, the old setup would render the URL like this:

http://localhost:8004/admin/entries/blog/17-my-first-blog

And now you should see this:

http://localhost:8004/admin/entries/blog/17-my-first-blog?site=spanish

This will be included in the Admin Bar 4.0 update, so if this doesn't fix your issue, please re-open this issue and I'll continue to look into it.