Skip to content

Commit

Permalink
[#2375] Template doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 20, 2012
1 parent 57111cb commit bc6b9e8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions doc/templating.rst
Expand Up @@ -127,6 +127,9 @@ language.
Includes
~~~~~~~~

.. Note:
Includes should be avoided as they are not portable use {% snippet %} tags whenever possible.
Snippets of text that are included using ``{% include %}`` should be
kept in a directory called _snippets_. This should be kept in the same
directory as the code that uses it.
Expand All @@ -138,6 +141,9 @@ case the usage should be clearly documented.
Snippets
~~~~~~~~

.. Note:
{% snippet %} tags should be used in favour of h.snippet()
Snippets are essentially middle ground between includes and macros in
that they are includes that allow a specific context to be provided
(includes just receive the parent context).
Expand Down Expand Up @@ -210,14 +216,17 @@ portion that we wish to change. In this case the ``breadcrumb`` block.

::

{% ckan_extends "user/read.html" %}
{% ckan_extends %}

{# Remove the breadcrumb #}
{% block breadcrumb %}{% endblock %}

This function works recursively and so is ideal for extensions that wish to
add a small snippet of functionality to the page.

.. Note:
{% ckan_extend %} only extends templates of the same name.
snippet
~~~~~~~

Expand Down Expand Up @@ -474,9 +483,10 @@ Builds a form from the supplied form_info list/tuple.

::

form_info - A list of dicts describing the form field to build.
data - The form data object.
errors - The form errors object.
form_info - A list of dicts describing the form field to build.
data - The form data object.
errors - The form errors object.
error_summary - The form errors object.

Example

Expand Down

0 comments on commit bc6b9e8

Please sign in to comment.