X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/f50cd63e40d7dfc9ffb51b679748b0003fddb019..6ac457d4ac226a474e988dfb898682ae04a86eb0:/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)