Added docs for the db template loader and skeleton docs for templatetags. Updated...
[philo.git] / docs / templatetags.rst
1 Template Tags
2 =============
3
4 .. automodule:: philo.templatetags
5
6 Collections
7 +++++++++++
8
9 .. automodule:: philo.templatetags.collections
10                 
11         .. templatetag:: membersof
12         
13         membersof
14         ---------
15         
16         Usage::
17         
18                 {% membersof <collection> with <app_label>.<model_name> as <var> %}
19
20
21 .. automodule:: philo.templatetags.containers
22
23         .. templatetag:: container
24         
25         container
26         ---------
27         
28         Usage::
29         
30                 {% container <name> [[references <app_label>.<model_name>] as <variable>] %}
31
32 .. automodule:: philo.templatetags.embed
33
34         .. templatetag:: embed
35         
36         embed
37         -----
38         
39         The {% embed %} tag can be used in two ways.
40         
41         To set which template will be used to render a particular model::
42         
43                 {% embed <app_label>.<model_name> with <template> %}
44         
45         To embed the instance specified by the given parameters in the document with the previously-specified template (any kwargs provided will be passed into the context of the template)::
46         
47                 {% embed (<app_label>.<model_name> <object_pk> || <instance>) [<argname>=<value> ...] %}
48
49 .. automodule:: philo.templatetags.include_string
50
51         .. templatetag:: include_string
52         
53         include_string
54         --------------
55         
56         Include a flat string by interpreting it as a template.
57         
58         Usage::
59         
60                 {% include_string <template_code> %}
61
62 .. automodule:: philo.templatetags.nodes
63
64         .. templatetag:: node_url
65         
66         node_url
67         --------
68         
69         Usage::
70         
71                 {% node_url [for <node>] [as <var>] %}
72                 {% node_url with <obj> [for <node>] [as <var>] %}
73                 {% node_url <view_name> [<arg1> [<arg2> ...] ] [for <node>] [as <var>] %}
74                 {% node_url <view_name> [<key1>=<value1> [<key2>=<value2> ...] ] [for <node>] [as <var>] %}