Added documentation about variable scoping in "partials".
authorAlexandre Bourget <alex@bourget.cc>
Fri, 1 Jan 2016 21:08:39 +0000 (16:08 -0500)
committerSteve Francia <steve.francia@gmail.com>
Mon, 4 Jan 2016 17:42:48 +0000 (12:42 -0500)
docs/content/templates/partials.md

index 4f87e5e695e2cae22d2422936c622ba97cfb4f24..a05c9b32cfa403ce66e49d821bfb0a6001507607 100644 (file)
@@ -106,5 +106,21 @@ To reference a partial template stored in a subfolder, e.g. `/layout/partials/po
 
 Note that the subdirectories you create under /layout/partials can be named whatever you like.
 
-**For more examples of referencing these templates, see [single content
-templates](/templates/content/), [list templates](/templates/list/) and [homepage templates](/templates/homepage/).**
+For more examples of referencing these templates, see
+[single content templates](/templates/content/),
+[list templates](/templates/list/) and
+[homepage templates](/templates/homepage/).
+
+
+Variable scoping
+----------------
+
+As you might have noticed, `partial` calls receive two paramters.
+
+1. The first is the name of the partial and determines the file
+location to be read.
+2. The second is the variables to be passed down to the partial.
+
+This means the partial _only_ be able to access those variables. It is
+isolated and has no access to the outer scope. From within the
+partial, `$.Var` is equivalent to `.Var`