Adding template tag to render the microsite favicon
This commit is contained in:
@@ -5,6 +5,7 @@ based on the current micro site.
|
||||
from django import template
|
||||
from django.conf import settings
|
||||
from microsite_configuration import microsite
|
||||
from django.templatetags.static import static
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@@ -38,3 +39,12 @@ def platform_name():
|
||||
{% platform_name %}
|
||||
"""
|
||||
return microsite.get_value('platform_name', settings.PLATFORM_NAME)
|
||||
|
||||
|
||||
@register.simple_tag(name="favicon_path")
|
||||
def favicon_path(default=settings.FAVICON_PATH):
|
||||
"""
|
||||
Django template tag that outputs the configured favicon:
|
||||
{% favicon_path %}
|
||||
"""
|
||||
return static(microsite.get_value('favicon_path', default))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
{% block title %}<title>{% platform_name %}</title>{% endblock %}
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="{% static "images/favicon.ico" %}" />
|
||||
<link rel="icon" type="image/x-icon" href="{% favicon_path %}" />
|
||||
|
||||
{% compressed_css 'style-vendor' %}
|
||||
{% compressed_css 'style-app' %}
|
||||
|
||||
Reference in New Issue
Block a user