diff --git a/djangocms_blog/cms_plugins.py b/djangocms_blog/cms_plugins.py index c7f3103..665809d 100644 --- a/djangocms_blog/cms_plugins.py +++ b/djangocms_blog/cms_plugins.py @@ -7,6 +7,7 @@ from cms.plugin_pool import plugin_pool from .models import AuthorEntriesPlugin, LatestPostsPlugin, Post, BlogCategory from .forms import LatestEntriesForm +from .settings import BLOG_POSTS_LIST_TRUNCWORDS_COUNT class BlogPlugin(CMSPluginBase): @@ -23,6 +24,7 @@ class LatestEntriesPlugin(BlogPlugin): def render(self, context, instance, placeholder): context['instance'] = instance + context['TRUNCWORDS_COUNT'] = BLOG_POSTS_LIST_TRUNCWORDS_COUNT return context diff --git a/djangocms_blog/templates/djangocms_blog/plugins/latest_entries.html b/djangocms_blog/templates/djangocms_blog/plugins/latest_entries.html index 0941860..7b13d55 100644 --- a/djangocms_blog/templates/djangocms_blog/plugins/latest_entries.html +++ b/djangocms_blog/templates/djangocms_blog/plugins/latest_entries.html @@ -2,7 +2,7 @@
{% for post in instance.get_posts %} - {% include "djangocms_blog/includes/blog_item.html" with post=post %} + {% include "djangocms_blog/includes/blog_item.html" with post=post TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %} {% empty %}

{% trans "No article found." %}

{% endfor %}