我正在做一个小项目,我想我会付出wagtail http://wagtail.io/尝试一下。我现在想知道如何更改侧边栏中 wagtail 的管理徽标(下图左上图)。
我可以改变/static/wagtailadmin/images/wagtail-logo.svg
直接但这是错误的;)。
Wagtail 已经在官方文档中提供了解决方案,使用django-过度扩展 https://github.com/stephenmcd/django-overextends:
要替换默认徽标,请创建模板文件your_app/templates/wagtailadmin/base.html
覆盖 Branding_logo 块,如下所示:
{% overextends "wagtailadmin/base.html" %}
{% block branding_logo %}
<img src="{{ STATIC_URL }}images/custom-logo.svg" alt="Custom Project" width="80" />
{% endblock %}
Check 鹡鸰定制品牌 http://docs.wagtail.io/en/v1.3.1/advanced_topics/customisation/branding.html更多细节。
(编辑 2020 年 12 月)
注意:在最新版本的 Wagtail 中django-overextends
不再需要了。它现在使用默认值extends
tag of Django
模板。查阅文档 https://docs.wagtail.io/en/v2.11.3/advanced_topics/customisation/admin_templates.html了解更多信息
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)