From 101476da9b68d180f5028fb66bb7ba266946b4d6 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Tue, 28 Feb 2017 16:26:33 +0100 Subject: [PATCH] Only render pgSideNav if there is content If the navmenu is passed as an empty list, we render an empty list with , which is illegal HTML. Ensure that we have content before rendering by checking list length. --- templates/base/page.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/base/page.html b/templates/base/page.html index b8021a5..7f9e27d 100644 --- a/templates/base/page.html +++ b/templates/base/page.html @@ -1,6 +1,7 @@ {%extends "base/base.html" %} {%block layoutblock%}
+ {%if navmenu|length > 0%}
    {%for m in navmenu%} @@ -19,6 +20,7 @@ {%endfor%}
+ {%endif%}
{%block contents%}{%endblock%} -- 2.6.4 (Apple Git-63)