[ckan-dev] most popular groups in our own theme.
Matthew Fullerton
matt.fullerton at gmail.com
Fri Apr 26 15:09:50 UTC 2019
Dear Judith,
did you make any progress yet? It's been a while since I worked on
this kind of stuff, but
- do you have logs for the internal server error
and
- have you tried doing
{% with groups = h.example_theme_most_popular_groups() %}
{% for group in groups %}
<li>{{ group.display_name }}</li>
{% endfor %}
instead of trying to use the function directly with the for ... in
Best,
Matt
On Fri, 26 Apr 2019 at 08:56, Judith Moran <Judith.Moran at nt.gov.au> wrote:
>
> Hi,
>
>
>
> I am following the example in 2.8.2 guide for the above.
>
>
>
> https://docs.ckan.org/en/2.8/theming/templates.html?highlight=ckan.common
>
>
>
> Adding your own template helper functions
>
>
>
>
>
> I have successfully updated the plugin.py with the additions….. some syntax errors on indents but fixed them from the error log.
>
>
>
> Now when I add the simple code below….. I get “Server Error”
>
>
>
> The previous developer bypassed layout1.html and is using ONLY index.html to generate the home page.
>
> Does this make it any difference to adding the code into index.html instead of layout1.html??
>
>
>
>
>
>
>
>
>
> {% block featured_organization %}
>
>
>
> {# Show a list of the site's most popular groups. #}
>
> <h3>Most popular groups</h3>
>
> <ul>
>
> {% for group in h.example_theme_most_popular_groups() %}
>
> <li>{{ group.display_name }}</li>
>
> {% endfor %}
>
> </ul>
>
>
>
> {% endblock %}
>
>
>
> Anyone got any suggestions…
>
>
>
> Thx
>
>
>
> Judy.
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
More information about the ckan-dev
mailing list