Skip to content

Instantly share code, notes, and snippets.

@corentinbettiol
Created December 17, 2019 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corentinbettiol/d4e028938918224ade665e44d5d43e4f to your computer and use it in GitHub Desktop.
Save corentinbettiol/d4e028938918224ade665e44d5d43e4f to your computer and use it in GitHub Desktop.
Update of the template used to show the latest blog posts by author in a djangocms-blog plugin.
{% load i18n easy_thumbnails_tags %}{% spaceless %}
<div class="plugin plugin-blog">
<h3>{% trans "Authors" %}</h3>
<ul class="blog-authors">
{% for author in authors_list %}
<li><a href="{% url 'djangocms_blog:posts-author' author.get_username %}">
{{ author.get_full_name }}
<span>(
{% if author.count > 0 %}
{% blocktrans count articles=author.count %}1 article{% plural %}{{ articles }} articles{% endblocktrans %}
{% else %}{% trans "0 articles" %}{% endif %}
)</span>
</a></li>
{% empty %}
<li class="blog-empty"><p>{% trans "No article found." %}</p></li>
{% endfor %}
</ul>
</div>
{% endspaceless %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment