Commit e64d09fd by Felipe Montoya

Adding template tag to render the microsite favicon

parent f683a4c5
...@@ -5,6 +5,7 @@ based on the current micro site. ...@@ -5,6 +5,7 @@ based on the current micro site.
from django import template from django import template
from django.conf import settings from django.conf import settings
from microsite_configuration import microsite from microsite_configuration import microsite
from django.templatetags.static import static
register = template.Library() register = template.Library()
...@@ -38,3 +39,12 @@ def platform_name(): ...@@ -38,3 +39,12 @@ def platform_name():
{% platform_name %} {% platform_name %}
""" """
return microsite.get_value('platform_name', settings.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 @@ ...@@ -5,7 +5,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
{% block title %}<title>{% platform_name %}</title>{% endblock %} {% 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-vendor' %}
{% compressed_css 'style-app' %} {% compressed_css 'style-app' %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment