Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change django wagtail's admin logo

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).

github wagtail image

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

like image 363
GabLeRoux Avatar asked Jul 02 '14 16:07

GabLeRoux


2 Answers

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.


(Edit Dec - 2020)

Note: In the latests versions of Wagtail django-overextends is not needed anymore. It uses now the default extends tag of Django templates. Consult the docs for more information

like image 54
Dhia Avatar answered Sep 30 '22 07:09

Dhia


The logo is defined here:

https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailadmin/templates/wagtailadmin/base.html#L7

To override it, you'll need an app which contains templates/wagtailadmin/base.html and precedes wagtail in INSTALLED_APPS.

Good luck!

like image 24
tomd Avatar answered Sep 30 '22 07:09

tomd