diff --git a/docs/builtins.rst b/docs/builtins.rst index 9d61eca..d4cc99a 100644 --- a/docs/builtins.rst +++ b/docs/builtins.rst @@ -260,6 +260,12 @@ You can include another template using the `include` tag. {% include "comment.html" %} +By default the included file gets passed the current context. You can pass a sub context by using an optional 2nd parameter as a lookup in the current context. + +.. code-block:: html+django + + {% include "comment.html" comment %} + The `include` tag requires you to provide a loader which will be used to lookup the template.