diff --git a/docs/howto/change_logo_dashboard.rst b/docs/howto/change_logo_dashboard.rst deleted file mode 100644 index 4fa386d77..000000000 --- a/docs/howto/change_logo_dashboard.rst +++ /dev/null @@ -1,24 +0,0 @@ -Change Logo in Dashboard -======================== - -In your projects with Wagtail, maybe need switch the default logo to other image. For this, you need override the block ``logo_admin``:: - - {% extends "wagtailadmin/base.html" %} - - {% block admin_logo %} - Custom Project - {% endblock %} - - -Save this in your app, for example, ``dashboard`` to ``dashboard/templates/wagtailadmin/base.html`` and register before ``wagtailadmin``:: - - INSTALLED_APPS = ( - # ... - - 'dashboard', - - 'wagtail.wagtailcore', - 'wagtail.wagtailadmin', - - # ... - ) diff --git a/docs/howto/custom_branding.rst b/docs/howto/custom_branding.rst new file mode 100644 index 000000000..7fd1ad28a --- /dev/null +++ b/docs/howto/custom_branding.rst @@ -0,0 +1,31 @@ +Custom branding +=============== + +In your projects with Wagtail, you may wish to replace elements such as the Wagtail logo within the admin interface with your own branding. This can be done through Django's template inheritance mechanism, along with the `django-overextends `_ package. + +Install django-overextends with ``pip install django-overextends`` (or add ``django-overextends`` to your project's requirements file), and add ``'overextends'`` to your project's ``INSTALLED_APPS``. You now need to create a ``templates/wagtailadmin/`` folder within one of your apps - this may be an existing one, or a new one created for this purpose, for example, ``dashboard``. This app must be registered in ``INSTALLED_APPS`` before ``wagtail.wagtailadmin``:: + + INSTALLED_APPS = ( + # ... + + 'overextends', + 'dashboard', + + 'wagtail.wagtailcore', + 'wagtail.wagtailadmin', + + # ... + ) + +The template blocks that are available to be overridden are as follows: + +branding_logo +------------- + +To replace the default logo, create a template file ``dashboard/templates/wagtailadmin/base.html`` that overrides the block ``branding_logo``:: + + {% overextends "wagtailadmin/base.html" %} + + {% block branding_logo %} + Custom Project + {% endblock %} diff --git a/docs/howto/index.rst b/docs/howto/index.rst index c9826e4d5..5e92a73c9 100644 --- a/docs/howto/index.rst +++ b/docs/howto/index.rst @@ -9,4 +9,5 @@ How to deploying performance multilingual_sites + custom_branding contributing diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/base.html b/wagtail/wagtailadmin/templates/wagtailadmin/base.html index 1da6b4f97..3383887f3 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/base.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/base.html @@ -5,7 +5,7 @@