Use zinnia template tags in blog template

140 views Asked by At

I am using Zinnia to make backend for blog on my website. The frontend is read and I just want to plug in the backend to display blog list, archives, tags etc. Zinnia has templatetags to display these but I cannot find any documentation on how to use it.
If I have the frontend, how do I display blog list using templatetags?

1

There are 1 answers

0
Rahul Gupta On

To use any of the Zinnia template tags, you need to load them first at the top of your template. This can be done by:

{% load zinnia %}

After this you can use any of the Zinnia template tag.

Some Usage Example:

  • get_recent_entries

It will get the most recent entries and then display them. You can specify the number of items to be displayed and the template_name for the template to be used for displaying.

{% get_recent_entries 5 "my_template.html" %}
  • get_featured_entries

It will display the featured entries. You can specify number and template_name as the arguments for the template_tag.

{% get_featured_entries 5 "my_template.html" %}
  • get_popular_entries

It will display the popular entries. Here also, You can specify number and template_name as template_tag arguments.

{% get_popular_entries 5 "my_template.html" %}

Documentation:

For referring to the Zinnia documentation, check this link.

http://docs.django-blog-zinnia.com/en/develop/index.html