如何向Wagtail管理页面添加自定义左链接模型

huangapple go评论85阅读模式
英文:

How to add custom left-link models to wagtail admin page

问题

我一直在尝试向Wagtail管理界面侧边栏添加一个左侧链接,以便为管理员提供更简单的体验。我的最终目标是添加一个自定义对象的集合(已经创建),可以从Wagtail的管理界面的侧边栏进行编辑,并在站点的主页上显示该集合。

Wagtail左侧链接示例(取自官方文档)

我是Python/Django的新手,特别是Wagtail方面,但我在官方文档中没有找到有关此的帮助。是否有一种简单的方法来实现这个?或者您必须编辑Wagtail源代码?
非常感谢您的帮助。

英文:

I've been trying to add a left-link to the wagtail administration interface sidebar so that I can provide an easier experience to moderators.
My ultimate goal is to add a collection of custom objects (already made), editable from the sidebar from wagtail's admin interface, and displaying that collection on the site's home page.

Wagtail left links example (taken from official documentation)

I'm new to python/Django and especially new in Wagtail, but I didn't find any help with this on official documentation. Is there an easy way to do this? Or you have to edit Wagtail source code?
Thanks a lot in advance

答案1

得分: 3

Wagtail的modeladmin模块允许您为任意Django模型设置编辑界面,通过管理菜单访问。或者,对于更低级别的控制,您可以通过register_admin_menu_item挂钩添加菜单项。

英文:

Wagtail's modeladmin module allows you to set up editing interfaces for arbitrary Django models, available through the admin menu. Alternatively, for lower-level control, you can add menu items through the register_admin_menu_item hook.

huangapple
  • 本文由 发表于 2020年1月3日 23:39:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/59581336.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定