Ticket #8088: templates_doc.diff
File templates_doc.diff, 1.8 KB (added by , 16 years ago) |
---|
-
docs/templates.txt
877 877 "including" other templates within a template. 878 878 879 879 The template name can either be a variable or a hard-coded (quoted) string, 880 in either single or double quotes. 880 in either single or double quotes. **New in development version:**: 881 Filters may be applied for both variable and hard-coded string. 881 882 882 883 This example includes the contents of the template ``"foo/bar.html"``:: 883 884 … … 888 889 889 890 {% include template_name %} 890 891 892 **New in development version:**: This example includes the content of the 893 template whose name consists of value of the variable, followed by ``.txt`` 894 in lowercase:: 895 896 {% include template_name|lower|stringformat:"s.txt" %} 897 891 898 An included template is rendered with the context of the template that's 892 899 including it. This example produces the output ``"Hello, John"``: 893 900 … … 900 907 901 908 Hello, {{ person }} 902 909 910 .. admonition:: Warning 911 912 Only a hard-coded (quoted) string without any filter as a template name 913 raises ``TemplateDoesNotExist`` exception in debug mode, if such template 914 could not be found. In case of variable, or expression 915 containing filters, Django template system fails silently. 916 903 917 See also: ``{% ssi %}``. 904 918 905 919 load … … 1258 1272 1259 1273 Capitalizes the first character of the value. 1260 1274 1275 cat 1276 ~~~ 1277 1278 **New in Django development version** 1279 1280 Concatenates given string with argument. 1281 1282 For example:: 1283 1284 {{ value|cat:".txt" }} 1285 1286 if ``value`` is ``"note"``, the output will be ``note.txt`` 1287 1261 1288 center 1262 1289 ~~~~~~ 1263 1290 … … 1948 1975 * Textile 1949 1976 * Markdown 1950 1977 * ReST (ReStructured Text) 1978 * asciidoc 1951 1979 1952 1980 See the `markup section`_ of the `add-ons documentation`_ for more 1953 1981 information.