question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add "visit site" link on top left of Wagtail's admin UI (menu / sidebar)

See original GitHub issue

Hello,

Is your proposal related to a problem?

I think there should be a link to return to the site home page from the Wagtail’s admin like there is in a lot of CMS and even in the django-admin !

example in Wordpress :

wordpress-visit-site

In order to do that, I usually create a custom wagtail admin template which works great !

But sometimes, Wagtail’s update can “break” some parts of the UI of my custom template : with the latest update (from 2.15 to 2.16) I had to manually update my custom template to add new features of the wagtail UI (ex: the arrow button of the menu).

I know there is the solution to use the register_admin_menu_item hooks but the link will be under the logo and I think it would be better to place the link upper on the UI (top-left is a good place IMO).

wagtail-visit-site-menu

https://docs.wagtail.org/en/stable/reference/hooks.html#register-admin-menu-item

Describe the solution you’d like

It would be great to add a link on top left of the Wagtail’s admin

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
robmoormancommented, Feb 11, 2022

@nyleza @gasman we have this link in many applications:

@hooks.register("register_admin_menu_item")
def register_site_menu_item():
    return MenuItem(
        _("Go back to site"), "/?_=cms", classnames="icon icon-fa-globe", order=0,
    )

If you want to link to be multisite dependent (e.g. based on permissions) you can alter the url of the button by making a custom MenuItem and override the def get_context(self, request): method as via the request you’ll have your authenticated user available.

The same method can be used to set the url based on the Site, depending on your needs.

Screen Shot 2022-02-11 at 10 59 24
0reactions
lb-commented, Apr 11, 2022

Note. A similar issue was raised a while ago - I have closed it as a duplicate of this one. https://github.com/wagtail/wagtail/issues/2047

I personally think that this feature is useful but could be well served using our existing menu hooks system.

In general - adding links above the bird would be good to be able to add without too much complexity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add custom left-link models to wagtail admin page
My ultimate goal is to add a collection of custom objects (already made), editable from the sidebar from wagtail's admin interface, and ...
Read more >
Customising the menu item - Wagtail's documentation
You can use the following attributes and methods on the ModelAdmin class to alter the menu item used to represent your model in...
Read more >
How to build an interactive guide for ... - DEV Community ‍ ‍
Goal: Create a simple way for contextual guides to be shown to users while using Wagtail. Why: Wagtail's UI is quite intuitive, however, ......
Read more >
Get ready for Wagtail, the best Django CMS yet
Add your own admin menu items, which can go to any Django views or offsite URLs you desire. [caption align="left"] Wagtail admin sidebar...
Read more >
How to build an interactive guide for users in the Wagtail CMS ...
Why: Wagtail's UI is quite intuitive, however, ... You should now see a menu item 'Guide' in the left sidebar within Wagtail admin....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found