Skip to content

Commit

Permalink
[#847] Update custom helper function example
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Nov 26, 2013
1 parent e19a1d3 commit d925116
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Empty file.
@@ -1,7 +1,10 @@
{% ckan_extends %}

{% block secondary_content %}
{% block featured_group %}
{{ h.recently_changed_packages_activity_stream() }}
{% endblock %}

{% block featured_organization %}

{# Show a list of the site's most popular groups. #}
<h3>Most popular groups</h3>
Expand Down
8 changes: 4 additions & 4 deletions doc/theming/templates.rst
Expand Up @@ -453,12 +453,12 @@ as a template helper:
Now that we've registered our helper function, we need to call it from our
template. As with CKAN's default template helpers, templates access custom
helpers via the global variable ``h``.
Edit |index.html| to look like this:
Edit |layout1.html| to look like this:

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

Now reload your `CKAN front page`_ in your browser. You should see a list of
the most popular groups appear on the page.
Now reload your `CKAN front page`_ in your browser. You should see the featured
organization section replaced with a list of the most popular groups.

Simply displaying a list of group titles isn't very good. We want the groups to
be hyperlinked to their pages, and also to show some other information about
Expand Down

0 comments on commit d925116

Please sign in to comment.