X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/d807884e8aa5b94a79e5f130fd2ce711e287eb3a..35ebfbda5c0c2c862cc8e10b46c83545cb205178:/contrib/shipherd/templatetags/shipherd.py diff --git a/contrib/shipherd/templatetags/shipherd.py b/contrib/shipherd/templatetags/shipherd.py index 97475fd..98e3e6b 100644 --- a/contrib/shipherd/templatetags/shipherd.py +++ b/contrib/shipherd/templatetags/shipherd.py @@ -83,7 +83,13 @@ def recursenavigation(parser, token): @register.filter -def has_navigation(node): # optional arg for a key? +def has_navigation(node, key=None): + nav = node.navigation + if key is not None: + if key in nav and bool(node.navigation[key]): + return True + elif key not in node.navigation: + return False return bool(node.navigation)