+
{% for message in messages %}
diff --git a/pages/templatetags/__init__.py b/pages/templatetags/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/pages/templatetags/get_page.py b/pages/templatetags/get_page.py
new file mode 100644
index 0000000..f922490
--- /dev/null
+++ b/pages/templatetags/get_page.py
@@ -0,0 +1,14 @@
+from django.utils.translation import get_language
+from pages.models import PageContent
+from django import template
+
+register = template.Library()
+
+@register.simple_tag(takes_context=True)
+def get_page(context, slug):
+ request = context['request']
+ obj = PageContent.objects.filter(
+ language=get_language(),
+ page__slug=slug
+ ).first
+ return obj
{% if 'safe' in message.tags %}
@@ -35,6 +35,12 @@
{% endif %}
{% block content %}{% endblock %}
+