Skip to content

Commit

Permalink
[#847] Update {{ super() }} example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Nov 26, 2013
1 parent 6e97fbc commit c5cfc08
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Empty file.
14 changes: 0 additions & 14 deletions ckanext/example_theme/v06_super/templates/home/index.html

This file was deleted.

14 changes: 14 additions & 0 deletions ckanext/example_theme/v06_super/templates/home/layout1.html
@@ -0,0 +1,14 @@
{% ckan_extends %}

{% block featured_group %}

<p>This paragraph will be added to the top of the
<code>featured_group</code> block.</p>

{# Insert the contents of the original featured_group block: #}
{{ super() }}

<p>This paragraph will be added to the bottom of the
<code>featured_group</code> block.</p>

{% endblock %}
2 changes: 1 addition & 1 deletion doc/theming/templates.rst
Expand Up @@ -368,7 +368,7 @@ Extending parent blocks with Jinja's ``{{ super() }}``
If you want to add some code to a block but don't want to replace the entire
block, you can use Jinja's ``{{ super() }}`` tag:

.. literalinclude:: /../ckanext/example_theme/v06_super/templates/home/index.html
.. literalinclude:: /../ckanext/example_theme/v06_super/templates/home/layout1.html

When the child block above is rendered, Jinja will replace the
``{{ super() }}`` tag with the contents of the parent block.
Expand Down

0 comments on commit c5cfc08

Please sign in to comment.