Further polished embedding system - allowed for context-dependent embed nodes to...
[philo.git] / templatetags / nodes.py
index 8a98630..9721ec4 100644 (file)
@@ -25,7 +25,7 @@ class NodeURLNode(template.Node):
                if self.node:
                        node = self.node.resolve(context)
                else:
-                       node = context['node']
+                       node = context.get('node', None)
                
                if not node:
                        return settings.TEMPLATE_STRING_IF_INVALID
@@ -68,7 +68,7 @@ class NodeURLNode(template.Node):
 @register.tag(name='node_url')
 def do_node_url(parser, token):
        """
-       {% node_url [for <node>] [as <var] %}
+       {% node_url [for <node>] [as <var>] %}
        {% node_url with <obj> [for <node>] [as <var>] %}
        {% node_url <view_name> [<arg1> [<arg2> ...] ] [for <node>] [as <var>] %}
        {% node_url <view_name> [<key1>=<value1> [<key2>=<value2> ...] ] [for <node>] [as <var>]%}