本文介绍了如何更改django wagtail的管理标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开展一个小型项目,我想我会尝试的官方文档中的解决方案:



替换默认标志,创建一个模板文件 your_app / templates / wagtailadmin / base.html ,将覆盖块branding_logo,如下所示:

  {%overextendswagtailadmin / base.html%} 

{%block branding_logo%}
< img src ={{STATIC_URL}} images / custom-logo.svgalt =Custom Projectwidth =80/>
{%endblock%}

检查,了解更多详情。


I am working on a small project and I thought I'd give wagtail a try. I am now wondering how I could change wagtail's admin logo in the sidebar (top left image on the picture bellow).

I could change /static/wagtailadmin/images/wagtail-logo.svg directly but it'd be wrong ;).

解决方案

Wagtail already provide the solution in the official documentation using django-overextends:

To replace the default logo, create a template file your_app/templates/wagtailadmin/base.html that overrides the block branding_logo as follow:

{% overextends "wagtailadmin/base.html" %}

{% block branding_logo %}
    <img src="{{ STATIC_URL }}images/custom-logo.svg" alt="Custom Project" width="80" />
{% endblock %}

Check Wagtail Custom branding for more details.

这篇关于如何更改django wagtail的管理标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 22:34