From 01c545d72d8f2fcfea728328f507b7f87edf9847 Mon Sep 17 00:00:00 2001 From: Max Vyaznikov Date: Fri, 28 Feb 2014 13:23:54 +0300 Subject: [PATCH] BLOG_POSTS_LIST_TRUNCWORDS_COUNT for LatestEntriesPlugin --- djangocms_blog/cms_plugins.py | 2 ++ .../templates/djangocms_blog/plugins/latest_entries.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 %}