How can I change the sidebar from Wagtail?

孤者浪人 提交于 2019-12-05 18:49:49

The sidebar_content_panels code is not relevant here - it demonstrates how you would add an extra tab to the page editor, if your pages contained "main content" and "sidebar content" that you wanted to keep separate. It's nothing to do with the sidebar menu in the Wagtail admin.

It's possible to add new items to the admin menu using the register_admin_menu_item hook (http://docs.wagtail.io/en/v1.0/reference/hooks.html#register-admin-menu-item), but this doesn't support editing an existing item, so it won't be possible to change the label of the 'snippets' menu. However, you could look at the 'wagtailmodeladmin' package https://github.com/ababic/wagtailmodeladmin - this allows you to set up admin areas that work like the snippet editor, but exist at the top level of the menu.

Wagtail allows you to create custom menu on admin panel sidebar by extending wagtail's ModelAdmin

you can check the example and documentation for new v2.4 here.

https://docs.wagtail.io/en/v2.4/reference/contrib/modeladmin/index.html#summary-of-features

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!